Skip to content

feat(gar): publish to Artifact Registry - #511

Draft
lucaghersi wants to merge 1 commit into
mainfrom
setup-artifact-registry-action
Draft

lucaghersi wants to merge 1 commit into
mainfrom
setup-artifact-registry-action

Conversation

@lucaghersi

@lucaghersi lucaghersi commented Sep 14, 2026

Copy link
Copy Markdown

What

Everything needed to publish to Google Artifact Registry:

  • actions/setup-artifact-registry — federates and configures Docker, npm and Maven in one step
  • .github/workflows/template_gitops_gar.yml — the GitOps template, publishing through it

A service migrates by switching its uses: line and adding a permissions block. No registry credentials are passed.

    uses: Staffbase/gha-workflows/.github/workflows/template_gitops_gar.yml@v17
    permissions:
      contents: read
      deployments: write
      id-token: write

id-token: write has to be on the calling job — a called workflow cannot raise the caller's permissions.

Why it looks like this

A push is accepted only into images-publish, while deployments reference images, the virtual repository in front of it. That path is set in mops once, by hand, and Flux image automation rolls the tag from there.

So the template has no gitops-dev / gitops-stage / gitops-prod inputs: they make the action rewrite the whole image reference on every build, which pins the deployment to images-publish. Passing them fails with invalid input. A service using the file lists moves to image automation first.

With those gone, the released gitops-github-action@v8.2.1 is enough — no change and no release there.

docker-registry-api is passed explicitly: it is what the release retag talks to, and the action's default points at Harbor.

Before merging

  • Re-pin the three setup-artifact-registry references to the release tag.
  • Prove it on one service. The permissions semantics are from the documented rules, not an observed run.

actionlint clean. Requires the WIF pool from Staffbase/infrastructure#17340, applied. First consumer: Staffbase/satan#1169. Guide: Staffbase/infrastructure#17349.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@lucaghersi
lucaghersi force-pushed the setup-artifact-registry-action branch from 1f50c23 to 194d479 Compare September 14, 2026 16:23
@lucaghersi lucaghersi changed the title feat(actions): add setup-artifact-registry feat(gar): add an Artifact Registry template and setup action Sep 14, 2026
@lucaghersi
lucaghersi force-pushed the setup-artifact-registry-action branch 3 times, most recently from 6bb3ae6 to 96e65ab Compare September 14, 2026 16:51
@lucaghersi

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Sep 17, 2026
@lucaghersi
lucaghersi force-pushed the setup-artifact-registry-action branch from 11facbc to 5c352af Compare September 17, 2026 16:11
Adds `actions/setup-artifact-registry`, which federates through the workload
identity pool and configures Docker, npm and Maven from one step, and
`.github/workflows/template_gitops_gar.yml`, which publishes images through it.

A service calls the template and grants `id-token: write`; no registry
credentials are passed. Images go to `images-publish`, deployments reference the
`images` virtual repository in front of it, and that path is set in the GitOps
repository once, by hand, so the template carries no GitOps file lists.

`template_gitops.yml` is the Harbor equivalent and is untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@lucaghersi
lucaghersi force-pushed the setup-artifact-registry-action branch from 5c352af to e05cc88 Compare September 17, 2026 16:14
@lucaghersi lucaghersi changed the title feat(gar): add an Artifact Registry template and setup action feat(gar): publish to Artifact Registry Sep 17, 2026
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