Skip to content

ci: Add GitHub Container Registry (ghcr.io) publishing#151

Open
terafin wants to merge 1 commit into
willfarrell:mainfrom
intarweb:feat/add-ghcr-publishing
Open

ci: Add GitHub Container Registry (ghcr.io) publishing#151
terafin wants to merge 1 commit into
willfarrell:mainfrom
intarweb:feat/add-ghcr-publishing

Conversation

@terafin

@terafin terafin commented Jun 3, 2026

Copy link
Copy Markdown

Summary

This PR adds GitHub Container Registry (ghcr.io) as an additional publishing target alongside Docker Hub.

Motivation

Docker Hub's rate limiting (100 pulls/6hrs anonymous, 200 free) increasingly impacts CI/CD and self-hosted infrastructure. ghcr.io provides no rate limits for public images, a unified code+containers ecosystem, needs no extra secrets (uses the existing GITHUB_TOKEN), and reuses the same build — just an additional registry target.

Changes

In .github/workflows/github-build.yml (job multi):

  • Added permissions: block with contents: read and packages: write so the job can push to ghcr.io.
  • Added a "Login to GitHub Container Registry" step (docker/login-action@v3, registry: ghcr.io) after the existing DockerHub login, authenticating with ${{ github.actor }} and ${{ secrets.GITHUB_TOKEN }}.
  • In each existing conditional tag step (latest for main, {version} for tags), added a parallel ghcr_tag env var (ghcr.io/${{ github.repository }}:latest / :{version}) mirroring the existing Docker Hub tag strategy.
  • Added ${{ env.ghcr_tag }} to the tags: list of the existing Build and push step.

No changes to build args, context, platforms/multi-arch, cache, or the existing Docker Hub tags.

Backward Compatibility

Fully backward compatible — Docker Hub publishing is unchanged; this only adds an additional registry target.

Testing

  • Workflow YAML validated
  • Builds in maintainer CI on merge

🤖 Generated with Claude Code

🔧 One-time maintainer step: make the GHCR package public

Heads-up for maintainers: the first time this workflow publishes to ghcr.io/willfarrell/docker-autoheal, GitHub creates the package as private by default. To let users docker pull it without authentication, a maintainer needs to set its visibility to Public once:

Repo Packages → the new docker-autoheal package → Package settingsDanger ZoneChange visibilityPublic

It's a one-time action — subsequent pushes inherit the setting. (Flagged by an automated reviewer; surfacing it here so the rollout is smooth.)

@terafin terafin force-pushed the feat/add-ghcr-publishing branch from 59d97a2 to 9acf04d Compare June 4, 2026 04:45
terafin added a commit to intarweb/docker-autoheal that referenced this pull request Jun 6, 2026
Replaces single-branch Model A with the canonical Model B pattern:
- main stays upstream-clean (rebased daily onto upstream/main).
- dev is the deploy track, auto-regenerated each sync run as
  main + cherry-pick of every open intarweb→upstream PR's commits.
- build-from-source.yml now fires on push to [main, dev] and only
  promotes :latest when github.ref == refs/heads/dev.
- FORK_INFO.md updated to reflect Model B + auto-regen semantics
  and the PR willfarrell#151 patch row.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant