-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (47 loc) · 1.32 KB
/
deploy.yaml
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
name: 部署 Tiddlywiki 静态页面到 Github Pages
on:
push:
branches:
- main
- master
# paths:
# - "plugins/**"
# - "tiddlers/**"
# - "package.json"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.0
with:
node-version: '16'
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
- name: 安装 NodeJS 依赖
run: npm install
# - name: 运行zx构建
# run: npm run zx-build
- name: 构建在线版本网页
run: npm run buildonline
- name: 构建可下载离线版本的网页
run: npm run buildoffline
- name: Workbox 离线缓存
run: npx workbox injectManifest workbox-config.js
- name: Upload artifact
uses: actions/upload-pages-artifact@v2.0.0
with:
# Upload entire repository
path: ./public-dist
- name: 部署到GitHub页面
id: deployment
uses: actions/deploy-pages@v3.0.0