Skip to content

feat: add staging ECR deployment action for dev builds#6

Open
drernie wants to merge 7 commits into
mainfrom
251209-tabulator-extra-cols
Open

feat: add staging ECR deployment action for dev builds#6
drernie wants to merge 7 commits into
mainfrom
251209-tabulator-extra-cols

Conversation

@drernie
Copy link
Copy Markdown
Member

@drernie drernie commented Dec 15, 2025

Summary

Adds a reusable GitHub Action for deploying Lambda images to staging ECR, enabling developers to build and test dev images without touching production infrastructure.

Changes

  • New Action: lambda-deploy-ecr-staging/
    • action.yaml - Composite action definition with inputs for image tagging
    • upload_ecr_staging.sh - Script to push images to staging ECR

Key Features

  • ✅ Deploys to staging account (712023778557) only
  • ✅ Supports custom image tags (e.g., dev-feature-v1, dev-bugfix-123)
  • ✅ Single region deployment (us-east-1) by default, configurable
  • ✅ Auto-creates ECR repository if it doesn't exist
  • ✅ OIDC authentication with GitHub Actions
  • ✅ Follows same pattern as existing lambda-deploy-ecr action

Usage Example

- uses: quiltdata/gh-actions/lambda-deploy-ecr-staging@main
  with:
    dockerfile-path: Dockerfile
    docker-context-path: .
    name: tabulator
    image-tag: dev-my-feature-v1

Test Plan

  • Action syntax validated
  • Shell script follows bash best practices
  • End-to-end test with tabulator dev workflow (pending infrastructure deployment)

Related

  • Part of tabulator dev workflow improvements
  • Requires IAM infrastructure updates in infra-templates repo
  • Will be used by tabulator's new dev.yml workflow

🤖 Generated with Claude Code

Add reusable GitHub Action for deploying Lambda images to staging ECR.
This enables developers to build and test dev images without touching
production infrastructure.

Key features:
- Deploys to staging account (712023778557)
- Supports custom image tags (e.g., dev-feature-v1)
- Single region deployment (us-east-1) by default
- Auto-creates ECR repository if needed
- OIDC authentication with GitHub Actions

Related to tabulator dev workflow improvements.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@drernie
Copy link
Copy Markdown
Member Author

drernie commented Dec 15, 2025

✅ Infrastructure Deployed Successfully

The IAM infrastructure required for this action has been deployed to the staging account.

Deployed Resources

CloudFormation Stack: github-actions-staging (us-east-1, account 712023778557)

  1. IAM Managed Policy: TabulatorECRAccess

    • ARN: arn:aws:iam::712023778557:policy/TabulatorECRAccess
    • Grants ECR push/pull permissions for quiltdata/lambdas/tabulator
  2. IAM Role: GitHub-Testing-Tabulator

    • ARN: arn:aws:iam::712023778557:role/github/GitHub-Testing-Tabulator
    • Authenticated via OIDC from repo:quiltdata/tabulator:*
    • Attached Policy: TabulatorECRAccess
  3. CloudFormation Output: TestingRoleTabulator

    • Provides role ARN for GitHub Actions workflows

Status

  • ✅ Stack deployment: UPDATE_COMPLETE (2025-12-15)
  • ✅ Role verified and accessible
  • ✅ Policy attached and validated

Next Steps

This action is now ready to use! Once this PR is merged, the tabulator dev workflow can use it with:

- uses: quiltdata/gh-actions/lambda-deploy-ecr-staging@main
  with:
    dockerfile-path: Dockerfile
    docker-context-path: .
    name: tabulator
    image-tag: ${{ steps.tag.outputs.tag_name }}

The workflow will authenticate using the deployed IAM role and push images to staging ECR.

Related

  • Infrastructure PR: quiltdata/infra-templates#30 (merged to staging)
  • Workflow PR: quiltdata/tabulator#105 (ready to test)

🤖 Infrastructure deployed and verified

drernie and others added 6 commits December 15, 2025 17:48
New push-deployment action:
- Finds PR by branch name in source repository
- Extracts deploy:<branch> label to determine target
- Updates versions.csv in deployment repository
- Direct push to target branch (no PR creation)
- Comprehensive error handling and validation
- Detailed README with examples

Lambda deploy action improvements:
- Fix role name capitalization (tabulator -> Tabulator)
- Ensures proper IAM role name format
- Maintains compatibility with existing deployments

The push-deployment action enables automatic deployment
updates when dev tags are pushed, routing to the correct
environment based on PR labels.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Use printf with -F flag for multi-line commit messages instead of
heredoc syntax which was causing YAML parser errors. This resolves
the "Unrecognized named-value: 'inputs'" error by using environment
variables properly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The deployment repository stores versions.csv at t4/template/environment/versions.csv,
not in the root directory. This was causing the push-deployment action to fail
with "versions.csv not found in deployment repository".

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add GitHub Actions cache support to both ECR deployment actions:
- lambda-deploy-ecr-staging: Added --cache-from/--cache-to flags
- lambda-deploy-ecr: Added --cache-from/--cache-to flags

This enables BuildKit to cache Docker layers between workflow runs,
significantly reducing build times when only source code changes
(dependencies remain cached).

Works in conjunction with multi-stage Dockerfile optimizations
from docker-layer-caching branch.

Related: quiltdata/tabulator#107

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The file is located at t4/template/environment/versions.csv, not versions.csv in the repo root.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The previous sed command was replacing the entire row with just
component,version which destroyed the other 6 CSV fields.

Changes:
- Use awk instead of sed to update only the version field (column 2)
- Preserve all other fields: ecr_account, ecr_region, ecr_prefix,
  ecr_repo, stage, notes
- Works correctly when multiple rows have same component name
  (e.g., tabulator prod vs dev)

This fixes the issue where updating tabulator would result in:
  tabulator,dev-xyz
instead of:
  tabulator,dev-xyz,712023778557,us-east-1,,,dev,Dev deployment...

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sir-sigurd
Copy link
Copy Markdown
Member

maybe we need only to add a debug flag or something like that instead of creating new action?

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.

2 participants