-
Notifications
You must be signed in to change notification settings - Fork 2
109 lines (92 loc) · 3.11 KB
/
deploy.yaml
File metadata and controls
109 lines (92 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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@d979d5b3a71173a29b74b5b88418bfda9437d885
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@fa648b43de3d4d023bcb3f89ed6940096949c419
- 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@d979d5b3a71173a29b74b5b88418bfda9437d885
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