forked from pypa/packaging.python.org
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.55 KB
/
deploy.yml
File metadata and controls
52 lines (46 loc) · 1.55 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
name: deploy
on:
push:
branches:
- xin
jobs:
# 这个工作流程包含一个名为 "build" 的 job
build:
# job 将运行的运行器的类型
runs-on: ubuntu-latest
# steps 将作为工作的一部分而执行的任务序列
steps:
# 这个动作在 $GITHUB_WORKSPACE 下签出你的版本库,以便工作流就可以访问它
- uses: actions/checkout@v2
# 设定 Python 环境
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
# 设定 conda 环境
- uses: s-weigand/setup-conda@v1
- run: conda --version
- run: which python
# 安装依赖包
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install sphinx-intl
# # 安装 HTML 主题 & 国际化
# - name: Install theme
# run: |
# git clone https://github.com/sphinx-locales/packaging.python.org.git draft
# 构建 Sphinx 文档
- name: Build the book
run: |
sphinx-build -b gettext source build/gettext
sphinx-intl update -p build/gettext -l zh_CN
sphinx-build -D language=zh_CN -b html source build/html
# 部署 HTML 到 gh-pages 分支
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3.6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/html
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"