-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (53 loc) · 1.69 KB
/
BuildGitHubPages.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: "Build GitHub Pages"
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
Build-GitHub-Pages:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
# Be sure to keep this in sync with .tugboat/config.yml.
node-version: 18
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v4
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
run: |
npm install
- name: Build Website
run: |
npm run build
- name: Archive build results
uses: actions/upload-artifact@v4
with:
name: _site
path: _site
Publish-GitHub-Pages:
runs-on: ubuntu-20.04
needs: [Build-GitHub-Pages]
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: _site
path: _site
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _site
exclude_assets: '.github,build.sh,CONTRIBUTING.md,install-calibre.sh,Dockerfile,package.json,yarn.lock,renovate.json,.tugboat,.gitignore'