Deploy to prod #35
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 to prod | |
concurrency: prod | |
on: | |
# Only manually triggered after testing preprod. | |
workflow_dispatch: | |
env: | |
AWS_REGION: us-east-1 | |
HOWDJU_RUNNING_IN_GITHUB_WORKFLOW: | |
NODE_VERSION: 18.18.2 | |
YARN_VERSION: 4.0.1 | |
jobs: | |
deployment: | |
runs-on: ubuntu-latest | |
environment: prod | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Corepack | |
# Enables yarn v2 | |
run: | | |
corepack enable | |
yarn set version ${{ env.YARN_VERSION }} | |
- name: Yarn install | |
run: yarn install | |
- name: Update API Lambda Alias | |
# Must have previously deployed to preprod. | |
run: yarn workspace premiser-api run update-lambda-function-alias --aliasName prod --newTarget pre-prod | |
- name: Deploy UI | |
run: yarn run deploy:ui:prod |