Skip to content

Deploy CDK (Production) #30

Deploy CDK (Production)

Deploy CDK (Production) #30

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