-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (49 loc) · 1.69 KB
/
ci.yml
File metadata and controls
57 lines (49 loc) · 1.69 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
name: Documentation
on:
push:
branches:
- master
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v5
- name: Configure Timezone
run: |
sudo timedatectl set-timezone "Asia/Shanghai"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install Dependencies
run: |
pip install zensical
- name: Build Documentation
run: |
zensical build --clean
- name: Configure Git
env:
DEPLOY_PRI: ${{ secrets.DEPLOY_PRI }}
GIT_USERNAME: ${{ github.repository_owner }}
GIT_EMAIL: ${{ github.repository_owner }}@user.github.com
run: |
mkdir -p ~/.ssh/
echo "${DEPLOY_PRI}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.name "${GIT_USERNAME}"
git config --global user.email "${GIT_EMAIL}"
- name: Commit Documentation File
env:
GIT_URL: 'git@github.com:licyk/SDNote.git'
run: |
git -C "${{ github.workspace }}/site" init
git -C "${{ github.workspace }}/site" remote add origin "${GIT_URL}"
git -C "${{ github.workspace }}/site" add -A
git -C "${{ github.workspace }}/site" commit -m "Documentation auto generated. Time: $(date +'%Y-%m-%d %H:%M:%S')"
- name: Push Documentation File
run: |
git -C "${{ github.workspace }}/site" push origin HEAD:gh-pages --force