-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (37 loc) · 1.03 KB
/
build.yml
File metadata and controls
44 lines (37 loc) · 1.03 KB
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
name: Build and Deploy
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3.7.0
with:
node-version: "12.x"
- name: Cache dependencies
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }}
- if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
name: Install dependencies
continue-on-error: true
run: npm install
- name: Build
run: npm run docs:build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs/.vuepress/dist