-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (80 loc) · 2.46 KB
/
ci.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI
on:
push:
branches:
- main
workflow_dispatch:
repository_dispatch:
types:
- update-triggered-by-wiki-repo
- update-triggered-by-plugins-repo
- update-triggered-by-styles-repo
- update-triggered-by-translators-repo
- update-triggered-by-blog-repo
- update-content
permissions:
contents: write
concurrency:
group: pages
cancel-in-progress: false
env:
TZ: Asia/Shanghai
jobs:
build:
name: Build
uses: ./.github/workflows/build.yml
secrets: inherit
deploy-github:
name: Deploy to GitHub Pages
if: github.ref_name == 'main' && github.event_name != 'pull_request' && github.repository == 'zotero-chinese/website'
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Build Output
uses: actions/download-artifact@v4
with:
name: build-result
path: dist
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
repository-name: zotero-chinese/zotero-chinese.github.io
branch: gh-pages
folder: dist
single-commit: true
token: ${{ secrets.ACCESS_TOKEN }}
git-config-name: github-actions[bot]
git-config-email: github-actions[bot]@users.noreply.github.com
# 当前将 netlify 链接到 zotero-chinese.github.io 仓库的 main 分支,启用自动构建,故无需此任务
# deploy-netlify:
# name: Deploy to Netlify
# if: github.ref_name == 'main' && github.event_name != 'pull_request' && github.repository == 'zotero-chinese/website'
# needs:
# - build
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Download Build Output
# uses: actions/download-artifact@v4
# with:
# name: build-result
# path: dist
# - name: Install pnpm
# uses: pnpm/action-setup@v3
# with:
# version: 9
# - name: Install Netlify CLI
# run: pnpm install -g netlify-cli
# - name: Push to Netlify
# uses: nick-fields/retry@v3
# with:
# timeout_minutes: 3
# max_attempts: 3
# command: netlify deploy --dir 'dist' --prod --debug
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}