Api Gateway Deploy [env: staging] #63
This file contains hidden or 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: Api Gateway Deploy | |
| run-name: "Api Gateway Deploy [env: ${{ inputs.env }}]" | |
| on: | |
| workflow_call: | |
| inputs: | |
| env: | |
| required: true | |
| type: string | |
| workflow_dispatch: | |
| inputs: | |
| env: | |
| description: "Deployment target environment" | |
| type: choice | |
| required: true | |
| options: | |
| - dev | |
| - test | |
| - staging | |
| - prod | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| HUSKY: 0 | |
| NODE_ENV: production | |
| AWS_REGION: eu-west-1 | |
| AWS_ROLE_TO_ASSUME: arn:aws:iam::603634817705:role/terramatch-microservices-github-actions | |
| AWS_ROLE_SESSION_NAME: terramatch-microservices-cicd-api-gateway | |
| PHP_PROXY_TARGET: ${{ vars.PHP_PROXY_TARGET }} | |
| ENABLED_SERVICES: ${{ vars.ENABLED_SERVICES }} | |
| jobs: | |
| deploy-api-gateway: | |
| runs-on: ubuntu-latest | |
| environment: ${{ inputs.env }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4.0.2 | |
| with: | |
| role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }} | |
| role-session-name: ${{ env.AWS_ROLE_SESSION_NAME }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: CDK Deploy | |
| id: cdk-deploy | |
| run: | | |
| cd cdk/api-gateway | |
| NODE_ENV=development npm i | |
| TM_ENV=${{ inputs.env }} npx --yes cdk context --clear | |
| TM_ENV=${{ inputs.env }} npx --yes cdk deploy --require-approval never |