-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (63 loc) · 2.27 KB
/
secure-post-merge.yml
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
name: SecurePipeline Docker build, ECR push, template copy to S3
on:
push:
branches:
- main
jobs:
dockerBuildAndPush:
name: Docker build and push
runs-on: ubuntu-latest
timeout-minutes: 15
env:
AWS_REGION: eu-west-2
permissions:
id-token: write
contents: read
packages: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Set up AWS creds #push assets to S3
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.UPLOAD_ASSETS_GH_ACTIONS_ROLE_ARN }}
aws-region: eu-west-2
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup .npmrc
run: |
cp .npmrc.template .npmrc && \
sed -i s/TOKEN_WITH_READ_PACKAGE_PERMISSION/${{ secrets.GITHUB_TOKEN }}/ .npmrc
- name: npm build assets, zip and sign
uses: govuk-one-login/github-actions/govuk/upload-assets@main
with:
signing-key-arn: ${{ secrets.UPLOAD_ASSETS_ZIP_SIGNING_KEY }}
stack-name: 'core-front'
destination-bucket-name: ${{ secrets.UPLOAD_ASSETS_ARTIFACT_SOURCE_BUCKET_NAME }}
- name: Set up AWS creds #push to ECR and do sam deploy
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.GH_ACTIONS_ROLE_ARN }}
aws-region: eu-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Login to GDS Dev Dynatrace Container Registry
uses: docker/login-action@v3
with:
registry: khw46367.live.dynatrace.com
username: khw46367
password: ${{ secrets.DYNATRACE_PAAS_TOKEN }}
- name: Deploy SAM app to ECR
uses: govuk-one-login/[email protected]
with:
artifact-bucket-name: ${{ secrets.ARTIFACT_BUCKET_NAME }}
container-sign-kms-key-arn: ${{ secrets.CONTAINER_SIGN_KMS_KEY }}
working-directory: ./deploy
docker-build-path: .
template-file: template.yaml
role-to-assume-arn: ${{ secrets.GH_ACTIONS_ROLE_ARN }}
ecr-repo-name: ${{ secrets.ECR_REPOSITORY }}
checkout-repo: false