Repository navigation
ci: add publish workflow (build, scan, push without deploy) and call it from cd - #7
Merged
Merged
Conversation
…out deploying cd.yml now runs the deploy-freeze preflight, calls publish.yml, then set-version and deploy. publish.yml can also be dispatched on its own to push <repo>:<sha7> to ECR for any branch without changing what is deployed. Refs OP-271
There was a problem hiding this comment.
🟡 Changes recommended
The workflows can deploy dev instead of the selected revision and publish images even when vulnerability scanning fails.
2 open issues
What changed in this PR
Separates image publishing from deployment so branches can be built and pushed to ECR for testing without changing shared DEV.
Changes:
- Adds a standalone, reusable publish workflow with image-existence checks, builds, vulnerability scanning, and pushing.
- Refactors CD to run a deploy-freeze check before publishing, setting the version, and deploying.
- Updates builds to use explicit refs, Buildx, ECR mirrors, registry caching, and commit-based artifact names.
| File | Description |
|---|---|
.github/workflows/publish.yml |
Adds image publishing without deployment. |
.github/workflows/cd.yml |
Delegates publishing and adds the preflight deployment check. |
.github/workflows/build.yml |
Adds ref selection, cached Buildx builds, and commit-based artifacts. |
Review effort: Balanced
…ia env - Dispatch form hints: REPO_REF is optional and defaults to the branch picked in "Use workflow from"; UUID is for automation only. - cd.yml passes pull_request.merge_commit_sha so a merged-PR run builds the commit that PR produced, not whatever the base branch points at when the run starts. - publish.yml reads REPO_REF from env in the setup script instead of interpolating it into shell. Refs OP-271
| name: ${{ github.job.name }} | ||
| runs-on: ${{ vars.RUNNER_TYPE }} | ||
| permissions: | ||
| id-token: write |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds
publish.yml, which builds, scans and pushes the service image to ECR without deploying it, and makescd.ymlcall it.Ticket: OP-271
Why
cd.ymlwas the only way to push an image, and it always deployed. Building an image of a branch for local or ephemeral-cell testing meant deploying that branch to shared DEV.What changes
publish.yml(new):setup → check-image → build → vulnerability-scan → tag-push, the same jobs and helper workflowscd.ymlused. Triggers:workflow_dispatch(inputsREPO_REF,AWS_ENV,UUID) andworkflow_call. OutputsCOMMIT_SHAandRELEASE_VERSION.cd.yml:preflight → publish → set-version → deploy.preflightis the shared deploy-freeze check (preflight-deploy.yml), so an active freeze now also skips the build.[no-deploy], dispatch inputs, theUUIDrun name used bydeploy-origin,v*release tagging andretag-existing.cd.ymlbuildspull_request.merge_commit_shaon a merged PR, so a run that starts late cannot pick up a later merge from the base branch.publish.ymlreadsREPO_REFfromenvin its setup script instead of interpolating it into shell.build.yml: brought to the standard shape. TakesREPO_REF, builds with buildx, the ECR mirror and the registry cache, and names the tarball and artifact after the built commit, which is whatvulnerability-scanandtag-pushlook up.publish.ymladds thecheck-imageandvulnerability-scansteps this repo did not run.Build an image of your branch
Actions → Publish → Run workflow:
publish.yml(created or rebased after this merge): pick it in Use workflow from and leave every field as is.The image is pushed to dev ECR as
<repo>:<first 7 characters of the commit SHA>. Nothing is deployed.Checks
actionlintpasses on the changed workflows.cd.yml→publish.ymlchain ran on origin-l10n-svc after #88 merged: preflight, setup, check-image, build, tag and push to ECR all succeeded.