-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 2.02 KB
/
deploy-gitee.yml
File metadata and controls
75 lines (64 loc) · 2.02 KB
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
name: Build and Deploy to Gitee Pages
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: deploy-gitee-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # 获取完整历史,便于推送到新分支
- name: Set up node
uses: actions/setup-node@v6
with:
node-version: 22
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Install dependencies
run: pnpm install
- name: Build project
run: pnpm web build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./apps/web/dist
publish_branch: dist
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy: ${{ github.sha }}'
- name: Sync to Gitee
uses: Yikun/hub-mirror-action@master
with:
src: github/doocs
dst: gitee/doocs
dst_key: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
dst_token: ${{ secrets.GITEE_TOKEN }}
static_list: "md"
force_update: true
debug: true
- name: Deploy Gitee Pages
uses: yanglbme/gitee-pages-action@main
with:
gitee-username: ${{ secrets.GITEE_USERNAME }}
gitee-password: ${{ secrets.GITEE_PASSWORD }}
gitee-repo: doocs/md
branch: dist
- name: Deployment Summary
run: |
echo "✅ Build completed successfully!"
echo "📦 Artifacts pushed to dist branch"
echo "🔄 Synced to Gitee repository"
echo "🚀 Gitee Pages deployed"
echo ""
echo "Gitee Pages: https://doocs.gitee.io/md/"