-
-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (42 loc) · 1.19 KB
/
build.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
name: Index and build site
on:
push:
branches:
- master
schedule:
- cron: "0 */2 * * *"
jobs:
index:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Setup git user
run: |
git config user.email "<>"
git config user.name "${GITHUB_ACTOR}"
- name: Setup gh-pages branch
run: |
git checkout gh-pages || (git checkout --orphan gh-pages && git reset && touch .nojekyll && git add .nojekyll && git commit -m "gh-pages init" && git clean -fdx)
git checkout -
- name: Setup gh-pages worktree
run: |
git worktree add build gh-pages || echo "build worktree exists"
- name: NPM install
run: |
npm i
- name: Build index and site
env:
GH_TOKEN: ${{secrets.GH_TOKEN}}
run: |
npm run clean
npm run build
- name: Commit and push gh-pages
run: |
cd build
git add .
git commit -m "Building gh-pages from ${GITHUB_SHA}"
git push https://wesleytodd:${{secrets.GH_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git gh-pages