ci: Add GitHub Container Registry (ghcr.io) publishing#1020
Open
terafin wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds GitHub Container Registry (ghcr.io) as an additional publishing target alongside Docker Hub.
Refs #969
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
.github/workflows/release.yaml:packages: writeto the existing top-levelpermissions:block (keptcontents: write).docker/login-action@v3,registry: ghcr.io,username: ${{ github.actor }},password: ${{ secrets.GITHUB_TOKEN }}) immediately after the existing Docker Hub login. The Docker Hub login has noif:guard (this workflow only triggers onv*tag pushes), so the ghcr login mirrors that with no guard..goreleaser.yaml:ghcr.io/{{ .ProjectName }}image template to each per-archdockers:entry (amd64, arm64, armv7), alongside the existing Docker Hub image templates, via new YAML anchors. Existing image templates, build flags, platforms, and Dockerfile are unchanged.docker_manifests:entries mirroring the existing ones —ghcr.io/{{ .ProjectName }}:{{ .Tag }}andghcr.io/{{ .ProjectName }}:latest(skip_push: auto) — referencing the new per-arch ghcr anchors. The existing Docker Hub manifests are untouched.The image name
glanceapp/glanceis already lowercase, so no case normalization was needed. The full multi-arch (amd64/arm64/armv7) tag strategy is mirrored exactly.Backward Compatibility
Fully backward compatible — Docker Hub publishing is unchanged; this only adds an additional registry target.
Testing
🤖 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/glanceapp/glance, GitHub creates the package as private by default. To let usersdocker pullit without authentication, a maintainer needs to set its visibility to Public once:It's a one-time action — subsequent pushes inherit the setting. (Flagged by an automated reviewer; surfacing it here so the rollout is smooth.)