Template application deploy #5728099438 #127
This file contains 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
name: Deploy | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'app/**' | |
- 'bin/**' | |
- 'infra/**' | |
- .github/workflows/cd.yml | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: "environment input" | |
required: true | |
default: "dev" | |
type: choice | |
options: | |
- dev | |
- staging | |
- prod | |
env: | |
# Need to set a default value for when the workflow is triggered from a git push, | |
# which bypasses the default configuration for inputs | |
ENVIRONMENT: ${{ inputs.environment || 'dev' }} | |
# Need to repeat the expression since env.ENV_NAME is not accessible in this context | |
concurrency: cd-${{ inputs.environment || 'dev' }} | |
jobs: | |
# Don't need to call the build-and-publish workflow since the database-migrations | |
# workflow already calls it | |
database-migrations: | |
name: Database migrations | |
uses: ./.github/workflows/database-migrations.yml | |
with: | |
environment: ${{ inputs.environment || 'dev' }} | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: [database-migrations] | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: arn:aws:iam::327446564135:role/platform-nextjs-github-actions | |
aws-region: us-east-1 | |
- name: Deploy release | |
run: make release-deploy ENVIRONMENT="$ENVIRONMENT" |