-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (66 loc) · 2.2 KB
/
deploy-branch.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
name: Deploy preview
on:
workflow_dispatch:
workflow_call:
outputs:
stack-name:
description: The deployed stack name
value: ${{ jobs.deploy.outputs.stack-name }}
aws-region:
description: The region in which the stack was deployed
value: ${{ jobs.deploy.outputs.aws-region }}
permissions:
id-token: write
contents: read
jobs:
build:
name: Build SAM app
runs-on: ubuntu-latest
permissions: {}
outputs:
cache-key: ${{ steps.build.outputs.cache-key }}
cache-restore-keys: ${{ steps.build.outputs.cache-restore-keys }}
steps:
- name: Install latest SAM
uses: aws-actions/setup-sam@v2
- name: Build SAM application
uses: govuk-one-login/github-actions/sam/build-application@e6b6ed890b35904e1be79f7f35ffec983fa4d9db
id: build
with:
template: infrastructure/template.yaml
cache-name: check-hmrc-api
pull-repository: true
source-dir: lambdas
deploy:
name: Deploy stack
runs-on: ubuntu-latest
timeout-minutes: 15
needs: build
concurrency:
group: deploy-development-${{ github.head_ref || github.ref_name }}
environment:
name: development
url: ${{ steps.deploy.outputs.stack-url }}
outputs:
aws-region: ${{ steps.deploy.outputs.aws-region }}
stack-name: ${{ steps.deploy.outputs.stack-name }}
steps:
- name: Deploy stack
uses: govuk-one-login/github-actions/sam/deploy-stack@e6b6ed890b35904e1be79f7f35ffec983fa4d9db
id: deploy
with:
sam-deployment-bucket: ${{ vars.DEPLOYMENT_ARTIFACTS_BUCKET }}
aws-role-arn: ${{ vars.DEPLOYMENT_ROLE_ARN }}
stack-name-prefix: preview-check-hmrc-api
cache-key: ${{ needs.build.outputs.cache-key }}
cache-restore-keys: ${{ needs.build.outputs.cache-restore-keys }}
s3-prefix: preview
pull-repository: true
delete-failed-stack: true
tags: |
cri:component=ipv-cri-check-hmrc-api
cri:stack-type=preview
cri:application=Orange
cri:deployment-source=github-actions
parameters: |
Environment=localdev