This Action is authored in primitivedotdev/primitive-mono-repo under tools/actions/deploy-function/ and mirrored on tag to the public repo primitivedotdev/deploy-function. External consumers pin a floating major (@v1) or an immutable patch (@v1.2.3) from the public repo.
The mirror is one-way: every release wipes the public tree and force-replaces it with the contents of tools/actions/deploy-function/. No PRs are accepted against the public repo.
Done once when this Action goes public.
gh repo create primitivedotdev/deploy-function \
--public \
--description "GitHub Action for deploying a Primitive Function — primitive.dev" \
--homepage https://primitive.devLeave the repo empty — the first tag push from this monorepo populates it.
The mirror workflow authenticates as the primitive-ci GitHub App, the same App used by sync-staging-to-main. The App is installed at the org level with repository_selection: "all", so deploy-function is covered automatically the moment the repo is created — no per-repo install step is needed. The App credential is read at run time from AWS Secrets Manager (staging/github-ci-app) via the existing OIDC role; no GitHub Actions secret to manage.
If repository_selection ever changes to selected in the future, add deploy-function to the install's repository list.
-
Confirm the change is on
main— the mirror workflow asserts the tag commit is reachable fromorigin/mainand refuses to publish otherwise. -
Pick a version following semver (
vX.Y.Z). Breaking changes bump the major. -
Tag locally and push:
git checkout main git pull --ff-only git tag deploy-function-action-v1.2.3 git push origin deploy-function-action-v1.2.3
-
Watch the mirror run:
gh run watch \ "$(gh run list --workflow mirror-deploy-function-action.yml --limit 1 --json databaseId --jq '.[0].databaseId')" -
Confirm the public repo updated:
# The mirror only pushes git tags (not GitHub Releases), so verify # against the tag list directly. gh api repos/primitivedotdev/deploy-function/tags --jq '.[].name' curl -fsSL https://raw.githubusercontent.com/primitivedotdev/deploy-function/v1/action.yml | head -20
The mirror always force-pushes a floating major tag (v1) pointing at the latest v1.x.y. Consumers who pin @v1 get the newest patch automatically. Consumers who pin @v1.2.3 get exactly that immutable version.
When you ship v2.0.0, the workflow creates v2 (new floating major) without touching v1 — so existing @v1 consumers stay on the v1 line until they explicitly upgrade.
If a release breaks consumers in production:
-
Tag the previous good commit with a new patch version that supersedes the broken one (don't try to "delete" the broken tag; consumers may have already pinned it):
git tag deploy-function-action-v1.2.4 <previous-good-sha> git push origin deploy-function-action-v1.2.4
The mirror will rebuild the public repo from that commit and move
v1to point atv1.2.4. -
If the breakage is in the bundled
dist/, you can also just revert + re-tag on the monorepo, sincedist/regenerates fromsrc/on every build (thecheck-dist.mjsCI guard ensures parity).