8000 feat(gh-action): add basic build & deploy workflows · mattwang44/python-docs-zh-tw@e94a651 · GitHub
[go: up one dir, main page]

Skip to content

Commit e94a651

Browse files
committed
feat(gh-action): add basic build & deploy workflows
1 parent e2e01d5 commit e94a651

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "3.7"
7+
- "3.8"
8+
- "3.9"
9+
10+
jobs:
11+
ci:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set env
17+
run: echo "VERSION=$(git branch --show-current)" >> $GITHUB_ENV
18+
19+
- name: Install Dependencies
20+
run: sudo apt-get install gettext
21+
22+
- name: Build
23+
run: VERSION={{ env.VERSION }} make

.github/workflows/deploy-gh-page.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: deploy-gh-page
2+
3+
on:
4+
push:
5+
branches:
6+
- "3.9"
7+
8+
jobs:
9+
cd:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Set env
15+
run: echo "VERSION=$(git branch --show-current)" >> $GITHUB_ENV
16+
17+
- name: Install Dependencies
18+
run: sudo apt-get install gettext
19+
20+
- name: Build
21+
run: VERSION={{ env.VERSION }} make
22+
23+
- name: Deploy to gh page
24+
uses: JamesIves/github-pages-deploy-action@3.7.1
25+
with:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
BRANCH: gh-pages
28+
FOLDER: ../cpython/Doc/build/html
29+
CLEAN: true

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LC_MESSAGES := $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES
2222
VENV := ~/.venvs/python-docs-i18n/
2323
PYTHON := $(shell which python3)
2424
MODE := autobuild-dev-html
25-
BRANCH = $(shell git describe --contains --all HEAD)
25+
BRANCH := $(or $(VERSION), $(shell git describe --contains --all HEAD))
2626
JOBS = 1
2727

2828

0 commit comments

Comments
 (0)
0