Deploy CDK (Production) #32
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 CDK (Production) | |
on: | |
workflow_run: | |
workflows: ["Test"] | |
types: | |
- completed | |
jobs: | |
deploy-production: | |
runs-on: ubuntu-latest | |
if: | | |
github.event.workflow_run.conclusion == 'success' && | |
github.event.workflow_run.event == 'release' | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install SOPS | |
run: | | |
SOPS_VERSION=3.9.1 | |
curl -LO "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.amd64" | |
sudo mv sops-v${SOPS_VERSION}.linux.amd64 /usr/local/bin/sops | |
sudo chmod +x /usr/local/bin/sops | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Configure AWS Credentials | |
run: | | |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws configure set default.region us-west-2 | |
shell: bash | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install dependencies | |
run: pnpm install | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and decrypt settings | |
run: pnpm dev --env=production | |
- name: CDK Bootstrap | |
run: pnpm cdk:bootstrap | |
- name: CDK Deploy | |
run: pnpm cdk:deploy --require-approval never |