CI updates to build latest container using master branch#212
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the CI infrastructure to build and publish a latest tagged container image from the master/main branch, while also modernizing workflow configurations and updating example files to reference the new GitHub Container Registry location.
Changes:
- Added new workflow to build and push
latestcontainer images from master/main branches - Updated all example Kubernetes Job YAML files to use the new container registry location (ghcr.io)
- Modernized existing workflows by updating Python version to 3.12 and renaming workflows for clarity
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/main-latest.yaml | New workflow to build, test, and push latest container images |
| .github/workflows/package.yaml | Updated workflow name and Python version to 3.12 |
| .github/workflows/docs.yaml | Added push triggers for master/main branches with path filters |
| .github/workflows/build-and-test.yaml | Updated workflow name and Python version to 3.12 |
| examples/ViewResultsJob.yaml | Updated image reference to ghcr.io and added imagePullPolicy |
| examples/StageInputDataJob.yaml | Updated image reference to ghcr.io and added imagePullPolicy |
| examples/CalrissianJob-revsort-single.yaml | Updated image reference to ghcr.io and added imagePullPolicy |
| examples/CalrissianJob-revsort-single-default-container.yaml | Updated image reference to ghcr.io and added imagePullPolicy |
| examples/CalrissianJob-fail-wf.yaml | Updated image reference to ghcr.io and added imagePullPolicy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Login to GHCR | ||
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
|
||
| - name: Build & push latest image | ||
| run: | | ||
| IMAGE_ID=ghcr.io/duke-gcb/calrissian/calrissian | ||
| docker build . --file Dockerfile --tag calrissian:latest | ||
| docker tag calrissian:latest $IMAGE_ID:latest | ||
| docker push $IMAGE_ID:latest No newline at end of file |
There was a problem hiding this comment.
The workflow will push Docker images to the container registry on every pull request, which is likely unintended behavior. The Docker login, build, and push steps should only run on pushes to master/main branches, not on pull requests. Consider adding a conditional check to these steps to prevent pushing images during pull request validation.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR updates the CI configuration to add a build for a
latesttag for the calrissian container image.