Fail fast if cdk diff fails #5
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
| name: CDK Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: cdk-deploy-main | |
| cancel-in-progress: false | |
| jobs: | |
| cdk-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| env: | |
| AWS_ACCOUNT_ID: ${{ vars.AWS_ACCOUNT_ID }} | |
| AWS_REGION: ${{ vars.AWS_REGION }} | |
| AWS_ROLE_NAME: ${{ vars.AWS_ROLE_NAME }} | |
| HEALTHCHECKS_URL: ${{ vars.HEALTHCHECKS_URL }} | |
| GOOGLE_DRIVE_IMPERSONATION_EMAIL: ${{ vars.GOOGLE_DRIVE_IMPERSONATION_EMAIL }} | |
| GOOGLE_DRIVE_FOLDER: ${{ vars.GOOGLE_DRIVE_FOLDER }} | |
| RCLONE_S3_REGION: ${{ vars.RCLONE_S3_REGION }} | |
| CRON_SCHEDULE: ${{ vars.CRON_SCHEDULE }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v5 | |
| with: | |
| role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/${{ env.AWS_ROLE_NAME }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Install Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .node-version | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run build | |
| run: npm run build | |
| - name: CDK Deploy | |
| run: | | |
| npx cdk deploy --all --require-approval never | |
| - name: Promote main -> production | |
| run: | | |
| git checkout production | |
| git merge main | |
| git push origin production |