-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (44 loc) · 1.17 KB
/
docs.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
name: Deploy documentation
on:
push:
branches:
- master
jobs:
pre_deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
outputs:
docs_changed: ${{ steps.docs-files.outputs.any_changed }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files in the docs folder
id: docs-files
uses: tj-actions/changed-files@v31
with:
files: docs/**
deploy:
runs-on: ubuntu-latest
needs: [pre_deploy]
if: needs.pre_deploy.outputs.docs_changed == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies ⏳
working-directory: ./docs
run: npm ci
- name: Build 🔧
working-directory: ./docs
run: npm run build
- name: Deploy docs to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build