Skip to content

Deploy Snapshot

Deploy Snapshot #539

# Deploy Snapshot — Forces a new ECS deployment of the dev service using current ECR images.
#
# Runs automatically after a successful Build Snapshot, or can be triggered manually to
# redeploy the latest snapshot images already in ECR (e.g. after an infrastructure change).
name: Deploy Snapshot
on:
workflow_run:
workflows: [ "Build Snapshot" ]
types: [ completed ]
workflow_dispatch:
inputs:
desiredCount:
description: 'Number of instances'
required: false
default: '3'
type: string
env:
CLUSTER_NAME: toolbox
SERVICE_NAME: toolbox-dev
jobs:
deploy:
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
# id-token: write lets this job mint a GitHub OIDC token to assume the AWS deploy role.
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/xh-github-actions-deploy
aws-region: ${{ secrets.AWS_REGION }}
- name: Deploy to ECS
run: |
aws ecs update-service \
--cluster ${{ env.CLUSTER_NAME }} \
--service ${{ env.SERVICE_NAME }} \
--desired-count ${{ inputs.desiredCount || '3' }} \
--force-new-deployment