feat(ci): Add GitHub Container Registry (ghcr.io) support for image publishing#334
feat(ci): Add GitHub Container Registry (ghcr.io) support for image publishing#334haishuok0525 wants to merge 2 commits intomainfrom
Conversation
- Add permissions for packages write to enable ghcr.io push - Add ghcr.io login step in build job - Add GHCR_REPOSITORY environment variable (ghcr.io/amd-agi/primussafe) - Update push loop to include ghcr.io alongside Docker Hub and Harbor Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR adds GitHub Container Registry (ghcr.io) as a third publishing destination for SaFE container images, alongside the existing Docker Hub and Harbor registries. The implementation uses GitHub's built-in GITHUB_TOKEN authentication, requiring no additional secrets configuration.
Changes:
- Added workflow permissions to enable GHCR package publishing
- Integrated ghcr.io login and push steps into the existing build workflow
- Added a build trigger comment to test the GHCR publishing functionality
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/build.yml |
Added GHCR authentication, repository configuration, and included ghcr.io in the multi-registry push loop |
SaFE/common/pkg/common/constant.go |
Added comment to trigger a build for testing GHCR push functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Trigger build for ghcr.io push test | ||
|
|
There was a problem hiding this comment.
This build trigger comment should be removed before merging. Temporary test triggers don't belong in production code and add no value to the codebase.
| // Trigger build for ghcr.io push test |
| build: | ||
| needs: detect-changes | ||
| runs-on: primus-safe-cicd-gfszt | ||
| runs-on: primus-safe-cicd-x8qwb |
There was a problem hiding this comment.
The runner label has changed from 'primus-safe-cicd-gfszt' to 'primus-safe-cicd-x8qwb'. This appears unrelated to the GHCR feature and should be explained in the PR description or moved to a separate commit.
| runs-on: primus-safe-cicd-x8qwb | |
| runs-on: primus-safe-cicd-gfszt |
Summary
Changes
permissions: packages: writeto enable GHCR pushGITHUB_TOKEN(no additional secrets required)GHCR_REPOSITORYenvironment variable (ghcr.io/amd-agi/primussafe)Image Locations
After this change, images will be available at:
docker.io/primussafe/<image>:<tag><harbor-host>/primussafe/<image>:<tag>ghcr.io/amd-agi/primussafe/<image>:<tag>Test Plan