Skip to content

Feature/cd

Feature/cd #2

Workflow file for this run

name: Deploy Space2Stats API Staging
on:
pull_request:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build:
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-Staging-Deploy-Role # Staging-specific IAM role
aws-region: ${{ env.CDK_DEFAULT_REGION }}
- name: Bootstrap CDK (if not done yet)
run: cdk bootstrap aws://${{ env.CDK_DEFAULT_ACCOUNT }}/${{ env.CDK_DEFAULT_REGION }}
- name: Deploy CDK stack to staging
env:
STAGE: dev
CDK_CERTIFICATE_ARN: ${{ env.STAGING_CDK_CERTIFICATE_ARN }} # Staging-specific certificate
CDK_DEFAULT_ACCOUNT: ${{ env.STAGING_CDK_DEFAULT_ACCOUNT }} # Staging-specific AWS account
CDK_DEFAULT_REGION: ${{ env.CDK_DEFAULT_REGION }}
CDK_DOMAIN_NAME: ${{ env.STAGING_CDK_DOMAIN_NAME }} # Staging-specific domain
run: cdk deploy --require-approval never