-
Notifications
You must be signed in to change notification settings - Fork 46
48 lines (40 loc) · 1.14 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
name: Deploy site
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-deploy-${{ hashFiles('package-lock.json') }}
- name: Install node modules
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install -f
- name: Build the site
run: |
echo $CONFIG_JSON > src/config.json
npm run build
cp build/index.html build/404.html
env:
CONFIG_JSON: ${{ secrets.CONFIG_JSON }}
- name: Deploy
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: gh-pages
FOLDER: build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}