forked from BrownCLPS/LingView
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 1.95 KB
/
build-and-deploy.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: Build & Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy-online:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Build online version
run: |
npm ci
npm run rebuild-db-online
npm run webpack
npm run bundle
env:
CI: true
REMOTE_MEDIA_PATH: ${{ secrets.REMOTE_MEDIA_PATH }}
- name: Deploy online version to GitHub Pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: bundle # The folder the action should deploy.
build-and-save-offline:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Build offline-compatible local version
run: |
npm ci
npm run rebuild-db-offline
npm run webpack
npm run bundle
mkdir bundle-offline
mv bundle bundle-offline/LingView
env:
CI: true
REMOTE_MEDIA_PATH: ${{ secrets.REMOTE_MEDIA_PATH }}
- name: Save offline-compatible local version as an artifact
uses: actions/upload-artifact@v2
with:
name: LingView-local
path: bundle-offline
- name: Message
run: echo "Saved offline-compatible local version of LingView as an artifact! When distributing, be sure to include the media files in the data/media_files/, keeping the original filenames."