👷(CI) add GHCR workflow for forked repo testing#1851
👷(CI) add GHCR workflow for forked repo testing#1851AntoLC merged 1 commit intosuitenumerique:mainfrom
Conversation
| push: | ||
| branches: | ||
| - 'main' | ||
| tags: | ||
| - 'v*' |
There was a problem hiding this comment.
Do you want to keep the same strategy? You will have the image only when the PR is merged, as I understand, or when a new release is made.
There was a problem hiding this comment.
@lunika Yes, this is the intention. Images can also be created on demand from the workflow_dispatch event. In short:
- When PR is merged → release as
maintag - When vX.Y.Z tag is created → release with version number as the tag
- When manually triggered → release as a commit-based tag
To generate an image using gh cli:
gh workflow run ghcr.yml --ref my-branch03a5f8e to
1dd800d
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Add workflow_dispatch-triggered workflow that builds and pushes images to GitHub Container Registry (ghcr.io). This allows forked repositories to build their own images for testing without requiring Docker Hub credentials. Images are tagged with branch names, semver tags, and commit SHA for easy testing of specific builds. Signed-off-by: dtinth on MBP M1 <dtinth@spacet.me>
1dd800d to
3378544
Compare
Purpose
When I fork the project to make improvements, I want to be able to deploy it to my VPS for testing. I want an image built in a reproducible way. However, the current
docker-hub.ymlis hardcoded to push to Docker Hub underlasuiteregistry.This PR adds a GitHub Actions workflow that builds and pushes Docker images to GitHub Container Registry (GHCR) trigger. This enables forked repositories to build their own images for testing without requiring Docker Hub credentials or having to configure any credentials at all.
I created this workflow while fixing #1788 (submitted as PR #1850). To verify it works, I ran the workflow on my fork:
This generates the images in my account:
Now I can test it on my VPS by pointing my Docker Compose to my built image:
Proposal
.github/workflows/ghcr.ymlwithworkflow_dispatchtrigger, based on existingdocker-hub.ymlsuitenumerique/docsrepo.ghcr.io/{owner}/{repo}/{service}Notes:
External contributions
Thank you for your contribution! 🎉
Please ensure the following items are checked before submitting your pull request:
git commit --signoff(DCO compliance)git commit -S)<gitmoji>(type) title description## [Unreleased]section (if noticeable change)