Skip to content

feat(ci): publish container image to ghcr.io#51

Merged
teslakoile merged 2 commits into
masterfrom
feat/ghcr-container-publish
Apr 25, 2026
Merged

feat(ci): publish container image to ghcr.io#51
teslakoile merged 2 commits into
masterfrom
feat/ghcr-container-publish

Conversation

@teslakoile

Copy link
Copy Markdown
Owner

Adds a container distribution channel for huly-cli on GitHub Container Registry, complementing the existing PyPI publish.

What changed

  • Dockerfile — multi-stage python:3.12-slim build that produces a wheel in stage one and installs it into a clean runtime stage. ENTRYPOINT ["huly"] so docker run ghcr.io/teslakoile/huly-cli ... behaves like the local CLI.
  • .dockerignore — keeps .git, tests/, caches, and .env files out of the build context.
  • .github/workflows/publish-ghcr.yml — builds and pushes on master (→ :latest) and on v* tags (→ :X.Y.Z, :X.Y, :latest) using docker/metadata-action. GHA cache enabled via type=gha.

Locally verified: image builds clean, docker run --rm huly-cli:test --version returns 0.1.7, --help renders the full Typer command tree.

Notes

  • After the first successful publish, the package needs to be linked to this repo manually (Package settings → "Connect repository") and visibility set to public if unauthenticated docker pull is desired.
  • The permissions: packages: write block on the workflow should cover GHCR pushes without changing the org-level Actions permissions, but if the first run 403s, flip Settings → Actions → General → Workflow permissions to "Read and write."

Adds a multi-stage Dockerfile and a GHCR publish workflow that fires on
master pushes (tagged :latest) and v* tags (tagged :X.Y.Z and :X.Y), so
huly-cli can be pulled as ghcr.io/teslakoile/huly-cli alongside the
existing PyPI distribution.
Adds an unprivileged huly user (uid 1000) to the runtime stage so the
container doesn't run as root, pins the docker/* actions to exact patch
versions matching publish-pypi.yml's pinning style, and removes the
redundant branch-name tag (`latest` already covers default-branch pushes).
@teslakoile teslakoile merged commit 6f645ad into master Apr 25, 2026
1 check passed
@teslakoile teslakoile deleted the feat/ghcr-container-publish branch April 25, 2026 14:29
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