Skip to content

Commit 0ff7a68

Browse files
committed
Add GitHub Actions workflows for building and linting documentation
1 parent 28a358f commit 0ff7a68

File tree

3 files changed

+108
-52
lines changed

3 files changed

+108
-52
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Build and Deploy to GitHub Pages
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *'
6+
push:
7+
branches:
8+
- 3.13
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout Python repository
25+
uses: actions/checkout@v4
26+
with:
27+
repository: python/cpython
28+
ref: 3.13
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: '3.11'
34+
35+
- name: Setup virtual environment
36+
run: make venv
37+
working-directory: ./Doc
38+
39+
- name: Checkout translation files
40+
uses: actions/checkout@v4
41+
with:
42+
path: Doc/locales/fa/LC_MESSAGES
43+
44+
- name: Pull latest translations
45+
run: git pull
46+
working-directory: ./Doc/locales/fa/LC_MESSAGES
47+
48+
- name: Setup problem matcher
49+
uses: sphinx-doc/github-problem-matcher@v1.1
50+
51+
- name: Build documentation
52+
run: make -e SPHINXOPTS="--color -D language='fa' -D gettext_allow_fuzzy_translations=1 -W --keep-going" html
53+
working-directory: ./Doc
54+
55+
- name: Setup Pages
56+
uses: actions/configure-pages@v4
57+
58+
- name: Upload artifact
59+
uses: actions/upload-pages-artifact@v3
60+
with:
61+
path: Doc/build/html
62+
63+
deploy:
64+
environment:
65+
name: github-pages
66+
url: ${{ steps.deployment.outputs.page_url }}
67+
runs-on: ubuntu-latest
68+
needs: build
69+
steps:
70+
- name: Deploy to GitHub Pages
71+
id: deployment
72+
uses: actions/deploy-pages@v4

.github/workflows/lint.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Lint Check
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
push:
7+
branches:
8+
- '*'
9+
pull_request:
10+
branches:
11+
- '*'
12+
workflow_dispatch:
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
continue-on-error: true
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.11'
28+
29+
- name: Install sphinx-lint
30+
run: pip install sphinx-lint
31+
32+
- name: Setup problem matcher
33+
uses: rffontenelle/sphinx-lint-problem-matcher@v1.0.0
34+
35+
- name: Run sphinx-lint
36+
run: sphinx-lint

.github/workflows/update-lint-and-build.yml

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

0 commit comments

Comments
 (0)