chore: add aws-deploy workflow #24
Workflow file for this run
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 AWS | |
on: | |
pull_request: | |
env: | |
FRONTEND_BUCKET: frontend | |
STACK_NAME: rst-dev | |
permissions: | |
id-token: write # This is required for GitHub OIDC auth with AWS | |
contents: read # This is required for actions/checkout | |
jobs: | |
deploy-infrastructure-to-aws: | |
runs-on: ubuntu-latest | |
environment: | |
name: development | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
# Build frontend | |
- name: Install frontend dependencies | |
uses: bahmutov/npm-install@v1 | |
with: | |
working-directory: ./frontend | |
- name: Build project | |
working-directory: ./frontend | |
run: npm run build | |
- name: Install CDK dependencies | |
uses: bahmutov/npm-install@v1 | |
with: | |
working-directory: ./infrastructure | |
- name: Provision infrastructure and deploy frontend to s3 with AWS CDK | |
working-directory: ./infrastructure | |
run: npm run deploy |