use policyai #122
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: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: "Environment to deploy to" | |
type: environment | |
required: true | |
push: | |
branches: | |
# - main | |
- '*dev' | |
- '*qa' | |
env: | |
TZ: America/New_York | |
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
TIER: ${{ secrets.TIER }} | |
jobs: | |
Deploy: | |
permissions: | |
contents: "read" | |
id-token: "write" | |
runs-on: ubuntu-latest | |
environment: ${{ (endsWith(github.ref, 'dev') && 'dev') || (endsWith(github.ref, 'qa') && 'qa') || inputs.environment || 'dev' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
# Note that role-to-assume MUST NOT CONTAIN the words "github" or "actions" in the ARN | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: ${{ secrets.AWS_REGION }} | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
- run: npm install -g aws-cdk | |
- run: echo "${{ secrets.ENV_FILE }}" > infrastructure/.env | |
- run: bash deploy.sh |