-
Notifications
You must be signed in to change notification settings - Fork 61
85 lines (82 loc) · 2.47 KB
/
test-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
76
77
78
79
80
81
82
83
84
85
name: test-and-deploy
on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
jobs:
build-emglken:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get Emglken commit ref
id: emglken-ref
run: echo "ref=$(git submodule status src/upstream/emglken | cut -c 2-13)" >> $GITHUB_OUTPUT
- name: Cache the built Emglken
id: cache-emglken
uses: actions/cache@v4
with:
path: |
src/upstream/emglken/build/*.js
src/upstream/emglken/build/*.wasm
key: emglken-${{ steps.emglken-ref.outputs.ref }}
- name: Build Emglken
if: steps.cache-emglken.outputs.cache-hit != 'true'
run: ./src/upstream/emglken/build.sh
outputs:
ref: ${{ steps.emglken-ref.outputs.ref }}
test-and-deploy:
needs: build-emglken
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
npm install
npm run link-local-emglken
cd src/iplayif.com/app && npm install
- name: Static tests
run: |
npm run lint
npm run tsc-check
- name: Restore Emglken from the cache
id: cache-emglken
uses: actions/cache@v4
with:
path: |
src/upstream/emglken/build/*.js
src/upstream/emglken/build/*.wasm
key: emglken-${{ needs.build-emglken.outputs.ref }}
- name: Build Parchment distributions
run: |
./build.js
./tools/make-single-file.js
./tools/package-inform7.sh
- name: Test storyfiles
run: ./tests/runtests.sh
- name: Check browser compatibility
run: ./tests/check-compat.sh
- run: cp tools/deploy.gitignore .gitignore
- name: Deploy to Pages 🚀
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: .
- name: Deploy to testing site 🚀
if: github.ref == 'refs/heads/testing'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
clean: false
folder: .
repository-name: ${{ secrets.PARCHMENT_TESTING_REPO }}
token: ${{ secrets.PARCHMENT_TESTING_TOKEN }}