[KIWI-2487] - replacing npm install with npm ci (#411) #17
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: Deploy Main to Build Env Dynamo Infra | |
| on: | |
| workflow_dispatch: | |
| # Triggers the workflow on push or pull request events but only for the "main" branch | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'infra-l2-dynamo/**' | |
| - .github/workflows/post-merge-dynamo-to-build.yml | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: # Only adding the variables in that are required for | |
| AWS_REGION: eu-west-2 | |
| jobs: | |
| deploy-to-build: | |
| name: Validate & Deploy Dynamo Infra template to Build Environment | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: infra-l2-dynamo | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| - name: Setup SAM CLI | |
| uses: aws-actions/setup-sam@v2 | |
| with: | |
| use-installer: true | |
| - name: Assume temporary AWS role | |
| uses: aws-actions/configure-aws-credentials@v4.0.2 | |
| with: | |
| role-to-assume: ${{ secrets.BUILD_RETURN_DDB_GH_ACTIONS_ROLE_ARN }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: SAM Validate | |
| run: sam validate --region ${{ env.AWS_REGION }} -t template.yaml | |
| - name: SAM Build | |
| run: sam build -t template.yaml | |
| - name: Deploy SAM app | |
| uses: govuk-one-login/devplatform-upload-action@v3.11.0 | |
| with: | |
| artifact-bucket-name: ${{ secrets.BUILD_RETURN_DDB_ARTIFACT_SOURCE_BUCKET_NAME }} | |
| working-directory: infra-l2-dynamo | |
| template-file: .aws-sam/build/template.yaml |