-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (49 loc) · 1.39 KB
/
docbuilder.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
name: docbuilder
on:
push:
branches:
- main
- test-branch
pull_request:
branches:
- main
- test-branch
jobs:
gh-release:
if: github.event_name != 'pull_request'
runs-on: ubuntu-22.04
steps:
- name: Checkout stuff
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
# Kanged from https://github.com/xiaomengxin-112/74690/blob/main/.github/workflows/main.yml
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: restore npm cache
uses: actions/cache@v2
id: use-npm-cache
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: restore npm dependencies
uses: actions/cache@v2
id: use-npm-depends
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-depends-${{ hashFiles('**/package-lock.json') }}
- name: Build site
run: |
npm i
npm run build
- name: Deploy
# Only run this on the main branch
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build