-
Notifications
You must be signed in to change notification settings - Fork 8
78 lines (73 loc) · 2.38 KB
/
ci_cd.yaml
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
name: ci_cd
on: push
jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
- name: Lint
run: npm run lint --if-present
- name: Build
run: npm run build --if-present
- name: Test
run: npm run test --if-present
- id: modified_paths_check
uses: fkirc/[email protected]
with:
paths_filter: |
backend:
paths:
- 'apps/backend/**'
bubble-proxy:
paths:
- 'apps/bubble-proxy/**'
frontend-example:
paths:
- 'apps/bubble-proxy/**'
infra:
paths:
- 'apps/infra/**'
paths:
- 'package-lock.json'
outputs:
should_skip: ${{ steps.modified_paths_check.outputs.should_skip }}
paths_result: ${{ steps.modified_paths_check.outputs.paths_result }}
cd_infra:
needs: ci
if: ${{ github.ref == 'refs/heads/master' && needs.ci.outputs.should_skip != 'true' || !fromJSON(needs.ci.outputs.paths_result).infra.should_skip }}
runs-on: ubuntu-latest
concurrency:
group: prevent-concurrent-jobs
timeout-minutes: 10
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
- name: Configure for deployment
if: github.ref == 'refs/heads/master'
run: |
echo "$INFRA_PULUMI_PASSPHRASE" > apps/infra/passphrase.prod.txt
mkdir -p ~/.aws
echo "$INFRA_AWS_CREDENTIALS" > ~/.aws/credentials
env:
INFRA_PULUMI_PASSPHRASE: ${{ secrets.INFRA_PULUMI_PASSPHRASE }}
# See the infra README - these should actually have details for Vultr Object Storage
INFRA_AWS_CREDENTIALS: ${{ secrets.INFRA_AWS_CREDENTIALS }}
- name: Deploy
if: ${{ github.ref == 'refs/heads/master' }}
run: npm run deploy:prod