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

Skip to content

Commit 4604c6c

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

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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: Install Dependencies
17+
run: sudo apt-get install gettext
18+
19+
- name: Build
20+
run: VERSION=${{ github.event.pull_request.base.ref }} make

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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: Install Dependencies
15+
run: sudo apt-get install gettext
16+
17+
- name: Build
18+
run: make
19+
20+
- name: Deploy to gh page
21+
uses: JamesIves/github-pages-deploy-action@3.7.1
22+
with:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
BRANCH: gh-pages
25+
FOLDER: ../cpython/Doc/build/html
26+
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