-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.59 KB
/
deploy-app.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
name: 'Capture Growth Chart: Build & Deploy'
on:
workflow_run:
workflows:
- 'Capture Growth Chart: verify app'
branches: master
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
install:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
deploy:
runs-on: ubuntu-latest
if: "!github.event.push.repository.fork && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Build & Deploy
shell: bash
env:
USERNAME: ${{ secrets.DHIS2_PROD_USERNAME }}
PASSWORD: ${{ secrets.DHIS2_PROD_PASSWORD }}
BASE_URL: ${{ secrets.DHIS2_PROD_URL }}
run: yarn deploy:test "$BASE_URL" --username "$USERNAME" --password "$PASSWORD"