Skip to content

Add GitHub Actions workflow to publish Docker images to GHCR#106

Merged
heydemoura merged 3 commits into
v2from
add/gh-action-for-docker-image-publishing
May 12, 2026
Merged

Add GitHub Actions workflow to publish Docker images to GHCR#106
heydemoura merged 3 commits into
v2from
add/gh-action-for-docker-image-publishing

Conversation

@heydemoura
Copy link
Copy Markdown
Contributor

Summary

  • Adds .github/workflows/docker-publish.yml, a new GitHub Actions workflow that builds docker/Dockerfile_jetmon and docker/Dockerfile_veriflier and publishes the images to ghcr.io/automattic/jetmon and ghcr.io/automattic/veriflier.
  • Pushes to the v2 branch publish both images tagged :latest. PRs labeled Docker Build publish both images tagged with the PR head short SHA (e.g. :a1b2c3d) for test deploys. Unlabeled PRs skip the job.
  • linux/amd64 only, with per-image GitHub Actions layer cache (type=gha, scoped per image) so the two builds don't invalidate each other.

One-time setup before this is fully usable

  • Create the PR label: gh label create "Docker Build" --description "Build & publish Docker images for this PR".
  • After the first successful v2 push, flip the GHCR package visibility / link to repo in the GHCR UI if the images should be pullable without auth.

Notes

  • PRs from forks will fail the push step because their GITHUB_TOKEN is read-only. We're an internal repo and this is acceptable; deferring pull_request_target due to its security implications.
  • No Dockerfile / Makefile / .dockerignore changes — the existing .dockerignore already excludes secrets and build artifacts.

Test plan

  • Merge / push to v2 and confirm both images appear under ghcr.io/automattic/{jetmon,veriflier}:latest via gh api /orgs/Automattic/packages/container/jetmon and …/veriflier.
  • docker pull ghcr.io/automattic/jetmon:latest and …/veriflier:latest; run each container briefly to confirm the binary starts.
  • Open a throwaway PR against v2, apply the Docker Build label, confirm a run starts and the resulting tags are :<short-sha> (no :latest).
  • Open another PR without the label and confirm the job is skipped (not failed).
  • Re-run the v2 workflow with no code changes and confirm the second run is materially faster (GHA cache hits visible in the buildx logs).

🤖 Generated with Claude Code

Publishes ghcr.io/automattic/jetmon and ghcr.io/automattic/veriflier
on pushes to the v2 branch (tagged latest) and on pull requests
labeled "Docker Build" (tagged with the PR head short SHA).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@heydemoura heydemoura self-assigned this May 12, 2026
heydemoura and others added 2 commits May 12, 2026 16:32
Adds docs/docker-images.md covering pull, tag scheme, env vars, ports,
volume mounts, validate-config, reload/drain, and PR-build pinning.
Links the new doc from the README documentation table.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a comment-pr job that runs after build-and-push on pull_request
events and upserts a sticky PR comment containing docker pull commands
for the freshly built jetmon and veriflier images. Uses an HTML marker
to identify the comment so subsequent runs update it in place rather
than appending duplicates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Docker images built for this PR

Built from 4b93118. Pull with:

docker pull ghcr.io/automattic/jetmon:4b93118
docker pull ghcr.io/automattic/veriflier:4b93118

Images are linux/amd64 only. On Apple Silicon, add --platform linux/amd64. See docs/docker-images.md for run examples.

@heydemoura heydemoura merged commit a0b54e7 into v2 May 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant