-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 2 KB
/
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: deploy
on:
schedule:
- cron: "0 0 */15 * *" # every 15 days
push:
branches: [master]
workflow_dispatch:
jobs:
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout config
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Build deployer executable
run: |
mkdir ./bin
go build -v -o bin ./cmd/webdata
- name: Extract service account data
run: |
echo $SERVICE_ACCOUNT > service_account.json
env:
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT }}
- name: Generate calendar data
run: |
./bin/webdata semester1.json semester2.json
mv -f semester*.json ./web/public/data/
env:
GOOGLE_APPLICATION_CREDENTIALS: ./service_account.json
- name: Compile WebAssembly wrapper
run: go build -o ./web/public/calendar.wasm ./cmd/wasm/main.go
env:
GOOS: js
GOARCH: wasm
- name: Set up React build
uses: actions/setup-node@v1
with:
node-version: 15.x
- name: Install React project dependencies
run: npm install
working-directory: web
- name: Build static React site
run: npm run build
working-directory: web
- name: Setup deployment
run: |
mkdir -p ./publish
mv -f web/build/* ./publish/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.0-8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./publish
# need to exclude .gitignore as actions-gh-pages wont deploy
# ignored files
exclude_assets: '.github,**/.gitignore'
force_orphan: true