Skip to content

Commit 986cbd1

Browse files
committed
Add github action. Remvoe CircleCI.
1 parent ac14b5a commit 986cbd1

File tree

5 files changed

+46
-43
lines changed

5 files changed

+46
-43
lines changed

.circleci/config.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v4
14+
with:
15+
python-version: '3.11'
16+
- run: pip install -r requirements.txt
17+
- run: make sphinx
18+
# Publish built docs to gh-pages branch.
19+
- name: Commit documentation changes
20+
run: |
21+
git clone https://github.com/wdv4758h/notes.git --depth 1 --branch gh-pages --single-branch gh-pages
22+
rm -rf gh-pages/*
23+
cp -r _build/html/* gh-pages/
24+
cd gh-pages
25+
touch .nojekyll
26+
git config --local user.email "[email protected]"
27+
git config --local user.name "GitHub Action"
28+
git add .
29+
git commit -m "Update documentation" -a || true
30+
# The above command will fail if no changes were present, so we ignore that.
31+
- name: Push changes
32+
uses: ad-m/github-push-action@master
33+
with:
34+
branch: gh-pages
35+
directory: gh-pages
36+
github_token: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sphinx:
1111
mv README.rst index.rst
1212

1313
# 用 Sphinx 編出網頁
14-
sphinx-build -T -E -b readthedocs -d _build/doctrees-readthedocs -D language=zh_TW . _build/html
14+
sphinx-build -j auto -T -E -b readthedocs -d _build/doctrees-readthedocs -D language=en . _build/html
1515

1616
push:
1717
# 為 Travis CI 設定 git 的 user.name 和 user.email

conf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
# source_parsers = { '.md': CommonMarkParser, }
1212
master_doc = 'index'
1313
project = u'wdv4758h-notes'
14-
copyright = u'2016'
14+
copyright = u'2023'
15+
language = 'en'
1516
version = 'latest'
1617
release = 'latest'
1718
exclude_patterns = ['_build']
@@ -105,7 +106,7 @@
105106
'MEDIA_URL': "https://media.readthedocs.org/",
106107
'PRODUCTION_DOMAIN': "readthedocs.org",
107108
'versions': [
108-
("latest", "/zh_TW/latest/"),
109+
("latest", "https://wdv4758h.github.io/notes/"),
109110
],
110111
'downloads': [
111112
("htmlzip", "//readthedocs.org/projects/wdv4758h-notes/downloads/htmlzip/latest/"),
@@ -114,8 +115,8 @@
114115
],
115116
'slug': 'wdv4758h-notes',
116117
'name': u'wdv4758h-notes',
117-
'rtd_language': u'zh_TW',
118-
'canonical_url': 'http://wdv4758h-notes.readthedocs.io/zh_TW/latest/',
118+
'rtd_language': u'en',
119+
'canonical_url': 'https://wdv4758h-notes.readthedocs.io/zh_TW/latest/',
119120
'analytics_code': '',
120121
'single_version': False,
121122
'conf_py_path': '/./',

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sphinx==2.3.0
2-
readthedocs-sphinx-ext==1.0.1
3-
sphinx_rtd_theme==0.4.3
4-
ghp-import==0.5.5
1+
sphinx==6.2.1
2+
readthedocs-sphinx-ext==2.2.2
3+
sphinx_rtd_theme==1.2.2
4+
ghp-import==2.1.0

0 commit comments

Comments
 (0)