-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (59 loc) · 1.75 KB
/
main.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
name: Deploy
on:
workflow_dispatch:
push:
branches:
- main
jobs:
quality-checks:
runs-on: ubuntu-latest
name: Quality Checks
steps:
- name: Check Out Repository
uses: 'actions/checkout@v2'
- name: Restore node_modules
id: cache-node-modules
uses: actions/cache@master
with:
path: node_modules
key: v1-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: NPM Install
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn
- name: Check Formatting
run: yarn prettier:check
- name: Lint
run: yarn lint:check
- name: Type Check
run: yarn build
- name: Unit Test
run: yarn test
deploy-stacks-cdk:
runs-on: ubuntu-latest
name: Deploy Stack '${{ matrix.stack }}' via CDK
needs: [quality-checks]
strategy:
matrix:
stack: [budgets, certificates, shared-dns]
env:
AWS_REGION: eu-west-2
steps:
- name: Check Out Repository
uses: 'actions/checkout@v2'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Restore node_modules
id: cache-node-modules
uses: actions/cache@master
with:
path: node_modules
key: v2-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: NPM Install
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn
- name: Deploy ${{ matrix.stack }}
run: yarn deploy ${{ matrix.stack }}