Deploy Snapshot #296
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
| # 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 | |
| # No GitHub token scopes needed — this job only uses AWS credentials from secrets. | |
| permissions: {} | |
| steps: | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| 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 |