-
Notifications
You must be signed in to change notification settings - Fork 81
79 lines (65 loc) · 2.16 KB
/
deploy-zh.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
name: Publish Chinese docs via GitHub Pages and upload to server
env:
ACTIONTEST: 3.8.0
on:
workflow_call:
secrets:
ZHSITE_PASSWORD:
required: true
push:
branches:
# Remember to add v before the following version number unless the version is master.
- v3.8.0
paths:
- 'docs-2.0-zh/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1 # fetch all commits/branches for gitversion
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name : prepare
run: sh ./prepare.sh
- name: Git Config
run: git config user.name ChrisChen2023 && git config user.email [email protected]
- name: Mike Deploy
run: |
python ./scripts/render_chinese_only.py
git fetch origin gh-pages-zh --depth=1 # fix mike's CI update
mike list
mike deploy ${{ env.ACTIONTEST }} -b gh-pages-zh -p --rebase
mike set-default ${{ env.ACTIONTEST }} -b gh-pages-zh -p --rebase
- name: show Chinese git branches
run: |
git branch
git checkout .
git checkout gh-pages-zh
- name: Compress
run: |
tar -vczf nebula-docs.tar.gz ${{ env.ACTIONTEST }} versions.json *.html
- name: Transfer
uses: appleboy/scp-action@master
with:
host: 47.99.143.59
username: root
password: ${{ secrets.ZHSITE_PASSWORD }}
port: 404
source: nebula-docs.tar.gz
target: /usr/web/
- name: UnCompress
uses: appleboy/ssh-action@master
with:
host: 47.99.143.59
username: root
password: ${{ secrets.ZHSITE_PASSWORD }}
port: 404
script: |
mkdir -p /usr/web/nebula-docs/
tar -xzf /usr/web/nebula-docs.tar.gz -C /usr/web/nebula-docs/
# mkdir -p /usr/web/nebula-docs/site/pdf/
# cp -f /var/www/ent-docs/${{ env.ACTIONTEST }}/pdf/NebulaGraph-CN.pdf /var/www/ent-docs/site/pdf/NebulaGraph-CN.pdf