Skip to content

ci: GitHub Actions workflow for Docker image build and push#6

Open
jtalborough wants to merge 7 commits intoRelayPlane:mainfrom
jtalborough:ci/docker-build
Open

ci: GitHub Actions workflow for Docker image build and push#6
jtalborough wants to merge 7 commits intoRelayPlane:mainfrom
jtalborough:ci/docker-build

Conversation

@jtalborough
Copy link

Summary

  • Adds GitHub Actions workflow for automated Docker image builds
  • Pushes to GitHub Container Registry (ghcr.io)
  • Triggers on pushes to main, version tags (v*), and PRs (build-only, no push)

Changes

  • .github/workflows/docker.yml (new): Multi-platform Docker build with GHA cache

Workflow details

  • Build triggers: Push to main, version tags v*.*.*, PRs
  • Push conditions: Only on push events (not PRs)
  • Tags: Branch name, semver (major, major.minor, full), git SHA
  • Registry: ghcr.io/${{ github.repository_owner }}/relayplane-proxy
  • Cache: GitHub Actions build cache for faster builds

Dependencies

Test plan

  • Workflow runs successfully on push
  • Docker image builds and pushes to GHCR
  • PR builds verify Dockerfile without pushing

Allow port and host to be configured via environment variables, with CLI
flags still taking precedence. This enables container deployments to set
defaults without modifying the command line.
Multi-stage build: builder stage compiles TypeScript, runtime stage has
only production dependencies. Non-root user (UID 1000) for K8s
securityContext compatibility.

Default port 4801 and host 0.0.0.0 set via env vars (requires the
RELAYPLANE_PROXY_PORT/HOST support from the cli-env-vars PR).
Builds and pushes to ghcr.io/jtalborough/relayplane-proxy on pushes to
main and version tags. PR builds validate the Dockerfile without pushing.
Uses GHA build cache for fast rebuilds.
node:18-alpine already has a node user/group at UID/GID 1000.
Creating a new group with GID 1000 fails.
Fall back to npm install when no lockfile is present. Uses npm ci
(faster, deterministic) when the lockfile exists, npm install otherwise.
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