ci: use deploy-ecr for production image publish#387
Conversation
| - name: Build and push Docker image | ||
| working-directory: docker | ||
| run: make push-ci VERSION=${{ steps.git.outputs.GIT_SHA }} | ||
| env: | ||
| DOCKER_DEFAULT_PLATFORM: linux/amd64 | ||
| AWS_REGION: us-east-1 | ||
|
|
||
| - name: Get Docker image URIs | ||
| id: deploy | ||
| uses: quiltdata/gh-actions/deploy-ecr@deploy-ecr | ||
| with: | ||
| dockerfile_path: docker/Dockerfile | ||
| docker_context_path: docker | ||
| docker_platform: linux/amd64 | ||
| build_args: | | ||
| VERSION=${{ steps.git.outputs.GIT_SHA }} | ||
| image_name: quiltdata/benchling | ||
| additional_tags: '["latest"]' | ||
| push_targets: '["prod"]' |
There was a problem hiding this comment.
AWS credentials missing in build-and-push job
The aws-actions/configure-aws-credentials step (with role-to-assume: arn:aws:iam::730278974607:role/github/GitHub-benchling-webhook) was removed from this job, and no equivalent credential inputs (e.g. role_to_assume, aws_region) are passed to the deploy-ecr action. If the action doesn't configure OIDC authentication internally, the ECR push will fail with an auth error. The id-token: write permission is still declared, but the workflow no longer wires any role ARN into the build-and-push job context.
|
|
||
| - name: Get Docker image URIs | ||
| id: deploy | ||
| uses: quiltdata/gh-actions/deploy-ecr@deploy-ecr |
There was a problem hiding this comment.
Action pinned to mutable branch, not a commit SHA
quiltdata/gh-actions/deploy-ecr@deploy-ecr references a branch name rather than an immutable commit SHA. If the branch is force-pushed or compromised, this workflow will silently run the new (potentially malicious) action code. Pin to a specific commit SHA, e.g.:
uses: quiltdata/gh-actions/deploy-ecr@<commit-sha>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Closing — branch is a workspace shim used to repin against quiltdata/gh-actions/docker-build-publish; not intended to merge. Branch retained for ad-hoc dispatches. |
Summary
Migrates
.github/workflows/prod.ymlto the unifieddeploy-ecraction onquiltdata/gh-actions/deploy-ecr@deploy-ecr.Behavior preserved:
quiltdata/benchlinglatestlinux/amd64VERSION=<git sha>is still passed as a Docker build arglatesttagNotes
This follows the migration plan in
07-unify-deploy-ecr.md._VERSIONSkeys were not found in this repo; image name was preserved from the existing workflow ECR URI.The previous workflow only built, pushed, and validated the image; it did not run
aws ecs update-service, so this PR does not addcluster_name/service_namedeployment inputs.Validation
YAML.load_filegit diff --check HEAD~1..HEADGreptile Summary
This PR replaces the manual build/push steps in
prod.ymlwith the unifiedquiltdata/gh-actions/deploy-ecr@deploy-ecrcomposite action, preserving the image name, platform, build args, and tags.aws-actions/configure-aws-credentialsstep was removed frombuild-and-pushwith norole_to_assumeor equivalent input passed to thedeploy-ecraction — if the action does not handle OIDC auth internally, the ECR push will fail.Confidence Score: 3/5
Hold for confirmation that deploy-ecr handles OIDC authentication internally before merging.
A P1 finding exists: the explicit AWS credential step was removed from the build job and no role ARN is passed to the deploy-ecr action. If the action requires pre-configured credentials, the workflow will fail on every push to main.
.github/workflows/prod.yml — specifically the build-and-push job and its credential setup
Important Files Changed
Sequence Diagram
sequenceDiagram participant GH as GitHub Actions participant DE as deploy-ecr action participant ECR as AWS ECR (Prod) participant V as validate job GH->>GH: Checkout & Extract git SHA GH->>GH: Set up Python / uv GH->>GH: Set up Docker Buildx GH->>DE: uses: deploy-ecr (image_name, build_args, push_targets=prod) Note over DE,ECR: AWS auth handled internally? DE->>ECR: docker build & push (SHA tag + latest) DE-->>GH: outputs.image_uri_prod GH->>GH: Record IMAGE_URI_LATEST (hardcoded account ID) GH->>V: needs: build-and-push (image_uri_sha, git_sha) V->>ECR: Pull & validate image (architecture + startup)Reviews (1): Last reviewed commit: "Use deploy-ecr for production image publ..." | Re-trigger Greptile