-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (76 loc) · 2.24 KB
/
ci.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build support-reminders
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
CI:
if: github.repository_owner == 'guardian'
# Required by actions-assume-aws-role
permissions:
id-token: write
contents: read
name: support-reminders build
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Env
run: env
- name: Dump GitHub context
id: github_context_step
run: echo $JSON
env:
JSON: ${{ toJSON(github) }}
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: './.nvmrc'
cache: 'yarn'
- name: Build project and generate Riff-Raff artefact
run: ./script/ci.sh
- name: Run unit tests
run: yarn test --silent
env:
TEST_DB_URL: postgresql://localhost/postgres
TEST_DB_USER: postgres
TEST_DB_PASSWORD: postgres
- name: Generate CFN templates from GuCDK
run: ./script/cfn.sh
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
if: >-
github.actor != 'dependabot[bot]'
&& github.event.pull_request.user.login != 'dependabot[bot]'
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
- name: Upload to Riff-Raff
uses: guardian/actions-riff-raff@v2
if: >-
github.actor != 'dependabot[bot]'
&& github.event.pull_request.user.login != 'dependabot[bot]'
with:
app: support-reminders
configPath: ./riff-raff.yaml
contentDirectories: |
support-reminders-cloudformation:
- ./cdk/cdk.out/SupportReminders-CODE.template.json
- ./cdk/cdk.out/SupportReminders-PROD.template.json
support-reminders:
- ./support-reminders.zip