Skip to content

Merge pull request #788 from govuk-one-login/dependabot/npm_and_yarn/… #43

Merge pull request #788 from govuk-one-login/dependabot/npm_and_yarn/…

Merge pull request #788 from govuk-one-login/dependabot/npm_and_yarn/… #43

Workflow file for this run

name: Deploy Application
permissions: {}
on:
push:
branches:
- main
paths:
- solutions/app-infra/**
- solutions/frontend/**
- solutions/api/**
- solutions/core/**
- solutions/stubs/**
- solutions/commons/**
- solutions/integration-tests/**
- .github/workflows/deploy.yaml
- package.json
- package-lock.json
- .npmrc
- .nvmrc
- tsconfig.json
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
publish-integration-tests-image:
runs-on: ubuntu-latest
permissions:
id-token: write
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Assume AWS role
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37
with:
role-to-assume: ${{ secrets.PIPELINE_GH_ACTIONS_ROLE_ARN }}
aws-region: "eu-west-2"
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@19d944daaa35f0fa1d3f7f8af1d3f2e5de25c5b7
- name: Build & publish Docker image
working-directory: solutions/integration-tests
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.POST_DEPLOY_TESTS_IMAGE_REPOSITORY }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$GITHUB_SHA -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
docker push -a $ECR_REGISTRY/$ECR_REPOSITORY
deploy:
needs: publish-integration-tests-image
runs-on: ubuntu-latest
permissions:
id-token: write
packages: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version-file: .nvmrc
- name: Set up SAM CLI
uses: aws-actions/setup-sam@89ddb14d60e682855e3fea4be85b3c56485de310
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Assume AWS role
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37
with:
role-to-assume: ${{ secrets.PIPELINE_GH_ACTIONS_ROLE_ARN }}
aws-region: "eu-west-2"
- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run install-all
- name: Build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run build:all
- name: Test
run: npm run test
- name: Deploy
uses: govuk-one-login/devplatform-upload-action@5879c30205266ad61e8299a4fcea76364530c9c1
with:
artifact-bucket-name: ${{ secrets.PIPELINE_SOURCE_BUCKET_NAME }}
signing-profile-name: ${{ secrets.SIGNING_PROFILE_NAME }}
working-directory: ./solutions/app-infra
template-file: .aws-sam/build/template.yaml