Feature/cd #7
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 Space2Stats API Staging | |
on: | |
pull_request: | |
branches: | |
- main | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build: | |
environment: "Space2Stats API Dev" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- name: Install AWS CDK | |
run: npm install -g aws-cdk | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: arn:aws:iam::017820688988:role/Space2Stats-Deploy-Role | |
aws-region: ${{ vars.CDK_DEFAULT_REGION }} | |
- name: Deploy CDK stack to staging | |
working-directory: ./space2stats_api/cdk | |
env: | |
STAGE: dev | |
PGHOST: ${{ secrets.PGHOST }} | |
PGPORT: ${{ secrets.PGPORT }} | |
PGDATABASE: ${{ secrets.PGDATABASE }} | |
PGUSER: ${{ secrets.PGUSER }} | |
PGPASSWORD: ${{ secrets.PGPASSWORD }} | |
PGTABLENAME: ${{ secrets.PGTABLENAME }} | |
CDK_CERTIFICATE_ARN: ${{ vars.STAGING_CDK_CERTIFICATE_ARN }} | |
CDK_DEFAULT_ACCOUNT: ${{ vars.STAGING_CDK_DEFAULT_ACCOUNT }} | |
CDK_DEFAULT_REGION: ${{ vars.CDK_DEFAULT_REGION }} | |
CDK_DOMAIN_NAME: ${{ vars.STAGING_CDK_DOMAIN_NAME }} | |
run: cdk deploy --require-approval never |