-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (79 loc) · 2.15 KB
/
build-deploy.yml
File metadata and controls
88 lines (79 loc) · 2.15 KB
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
87
88
name: build-deploy
on:
schedule:
- cron: '30 5 * * SAT'
push:
paths-ignore:
- '**/README.*md'
- 'notes/**'
- 'Python/**'
- 'R/**'
- 'Dockerfile*'
pull_request:
paths-ignore:
- '**/README.*md'
- 'notes/**'
- 'Python/**'
- 'R/**'
- 'Dockerfile*'
workflow_dispatch:
jobs:
build-deploy:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
with:
version: 14.x
- name: Checkout branch
uses: actions/checkout@v2
with:
path: app
- name: Checkout tgvejs (default branch)
uses: actions/checkout@v2
with:
repository: tgve/tgvejs
path: tgvejs
- name: Install
run: |
cd app
yarn install
cd ..
cd tgvejs
yarn install
- name: Build [local]
run: |
set -x
cd tgvejs
yarn link
yarn dist
cd ..
cd app
yarn link @tgve/tgvejs
yarn build-local
- name: Test (e2e)
run: cd app && yarn test
- name: Upload Snapshots
if: always()
uses: actions/upload-artifact@v1
with:
name: test-snapshots
path: app/src/__snapshots__
- name: Build [release]
if: github.ref == 'refs/heads/release'
run: |
set -x
cd app
IFS="/" read -a a <<< ${{ github.repository }}
PUBLIC_URL="https://${a[0]}.github.io/${a[1]}" yarn build
env:
CI: false
REACT_APP_DEFAULT_URL: https://raw.githubusercontent.com/tgve/example-data/main/casualties.csv
# REACT_APP_MAPBOX_ACCESS_TOKEN: ${{secrets.MAPBOX_KEY}}
- name: Deploy [release]
if: github.ref == 'refs/heads/release'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: app/build