-
Notifications
You must be signed in to change notification settings - Fork 272
49 lines (45 loc) · 1.35 KB
/
document.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
name: Deploy Document
on:
push:
branches:
- docs
workflow_dispatch:
inputs:
nothing:
description: 'This param do nothing'
required: false
type: boolean
default: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# https://stackoverflow.com/questions/60868897/git-log-dates-incorrect-in-a-github-action
fetch-depth: '0'
ref: docs
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Build
run: npm run docs:build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
- name: Sync Push to Gitee
env:
GITEE_AUTH: ${{ secrets.GITEE_AUTH }}
if: ${{ env.GITEE_AUTH != ''}}
run: |
echo "https://[email protected]/" > .credential
git config --local credential.helper "store --file=.credential"
git remote add gitee https://gitee.com/NiceLeee/BilibiliDown.git
branch_name=`git rev-parse --abbrev-ref HEAD`
# git fetch --unshallow origin "$branch_name"
git push -f gitee "$branch_name"
rm -f .credential