-
Notifications
You must be signed in to change notification settings - Fork 101
56 lines (54 loc) · 1.89 KB
/
deploy.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
name: 部署
on:
push:
branches:
- master
workflow_dispatch:
jobs:
buildAndUpdate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- run: npm run docs:build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs/.vitepress/dist
- name: 上传到 Github 的 gh-pages 分支
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: gh-pages
FOLDER: docs/.vitepress/dist
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate knownHost
run: ssh-keyscan gitee.com > giteeKnownHosts
- name: 上传到 Gitee 的 gh-pages 分支
uses: s0/git-publish-subdir-action@develop
env:
REPO: [email protected]:musicfree/MusicFree.git
BRANCH: gh-pages
FOLDER: docs/.vitepress/dist
SSH_PRIVATE_KEY: ${{ secrets.GITEE_DEPLOY_PRIVATE_KEY }}
KNOWN_HOSTS_FILE: giteeKnownHosts
- name: 创建 Gitee Page
uses: yanglbme/gitee-pages-action@main
with:
gitee-username: maotoumao
gitee-password: ${{ secrets.GITEE_PASSWORD }}
gitee-repo: musicfree/MusicFree
branch: gh-pages
deploy:
runs-on: ubuntu-latest
needs: buildAndUpdate
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2