Skip to content

feat: add docker-build and cloudrun-deploy composite actions#5

Open
gamechanger1s wants to merge 9 commits into
mainfrom
feat/docker-build-cloudrun-actions
Open

feat: add docker-build and cloudrun-deploy composite actions#5
gamechanger1s wants to merge 9 commits into
mainfrom
feat/docker-build-cloudrun-actions

Conversation

@gamechanger1s
Copy link
Copy Markdown

@gamechanger1s gamechanger1s commented May 25, 2026

Summary

Extends the reusable build and deploy actions in actions/build/action.yml and actions/deploy/action.yml to support GCP Artifact Registry + Cloud Run deployments alongside the existing static-build path. A third path — GHCR pull+retag — is also added to support services whose image is pre-built externally.

Changes

actions/build/action.yml

  • New Docker build+push path (activated by image-name): authenticates via WIF, optionally fetches build-time env vars from Secret Manager into .env.production, builds with Buildx, and pushes SHA + latest tags to Artifact Registry
  • New GHCR pull+retag path (activated by ghcr-image): pulls a pre-built image from GHCR, re-tags it for Artifact Registry (SHA + latest), and pushes it — no Dockerfile or build-time secrets required; takes priority over the Docker build path
  • All existing static-build steps are guarded with discriminator conditions — zero breaking changes

actions/deploy/action.yml

  • New Cloud Run path (activated by cloudrun-service): fetches runtime env vars from Secret Manager, formats them as KEY=VAL,..., and deploys via google-github-actions/deploy-cloudrun with overwrite strategy
  • Supports extra Cloud Run flags via cloudrun-flags input (e.g. VPC connector, ingress settings)
  • All existing static-deploy steps are unaffected

README.md

  • Added Docker + Cloud Run usage example
  • Added GHCR pull+retag usage example
  • Updated runner-contract note to document both new paths

SHA-pinned actions (all verified against GitHub)

Action SHA Version
get-secretmanager-secrets 2b5f97c5a4b9c105e64646762ad4fc3f5128e6f5 v2.2.5
setup-buildx-action 8d2750c68a42422c14e847fe6c8ac0403b4cbd6f v3.12.0
build-push-action 10e90e3645eae34f1e60eeb005ba3a3d33f178e8 v6.19.2
deploy-cloudrun 251330ba9a8a34bfbc1622895f42e1d53fd14522 v2.7.6

🤖 Generated with Claude Code

gamechanger1s and others added 9 commits May 25, 2026 17:01
docker-build: WIF auth → Secret Manager → .env.production → buildx build+push to Artifact Registry
cloudrun-deploy: WIF auth → Secret Manager → format env_vars → deploy-cloudrun
Both actions eliminate the need for separate publish jobs or inter-job Docker caches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Docker build+push path to build@v2 (activated by image-name input)
and Cloud Run deploy path to deploy@v2 (activated by cloudrun-service input).
Existing static-site callers are unaffected — new inputs default to empty
and all new steps are gated behind their respective discriminator inputs.
Remove standalone docker-build and cloudrun-deploy actions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ments

GitHub's YAML parser rejected inputs from both actions because UTF-8
multi-byte characters (U+2500, U+2014) in comment lines caused silent
parse failure, making all inputs appear undefined.
Replaces mutable version tags with pinned commit SHAs in the Docker
and Cloud Run steps of build and deploy actions to prevent supply
chain attacks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The --maintained-version CLI flag expects a semver constraint (e.g. 1)
not a prerelease identifier. Writing maintainedVersion to .semrelrc matches
how go-semantic-release expects the config, producing v{major}.x.y-rc.N tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add ghcr-image input to actions/build/action.yml. When set the action
pulls a pre-built image from GHCR, re-tags it for GCP Artifact Registry
(SHA + latest tags), and pushes it -- no Dockerfile or build-time secrets
required. All existing Docker build+push and static-build paths are
unaffected; each path is guarded by its own discriminator condition.

Update README with GHCR pull+retag usage example and runner-contract note.

Co-Authored-By: Claude Sonnet 4.6 <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