| 1 |
name: Docs |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
|
| 8 |
|
| 9 |
env: |
| 10 |
FORCE_COLOR: 1 |
| 11 |
|
| 12 |
permissions: {} |
| 13 |
jobs: |
| 14 |
build: |
| 15 |
permissions: |
| 16 |
contents: write # to push pages branch (peaceiris/actions-gh-pages) |
| 17 |
|
| 18 |
runs-on: ubuntu-latest |
| 19 |
steps: |
| 20 |
- name: Setup Python |
| 21 |
uses: actions/setup-python@v5 |
| 22 |
with: |
| 23 |
python-version: "3.x" |
| 24 |
- name: Checkout Pygments |
| 25 |
uses: actions/checkout@v4 |
| 26 |
- name: Install tox |
| 27 |
run: pip install -r requirements.txt |
| 28 |
- name: Sphinx build |
| 29 |
run: | |
| 30 |
tox -e web-doc -- dirhtml |
| 31 |
touch doc/_build/dirhtml/.nojekyll |
| 32 |
echo -e 'pygments.org\nwww.pygments.org' > doc/_build/dirhtml/CNAME |
| 33 |
echo 'Automated deployment of docs for GitHub pages.' > doc/_build/dirhtml/README |
| 34 |
- name: Deploy to repo |
| 35 |
if: github.repository_owner == 'pygments' |
| 36 |
uses: peaceiris/actions-gh-pages@v4 |
| 37 |
with: |
| 38 |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} |
| 39 |
external_repository: pygments/pygments.github.io |
| 40 |
publish_branch: master |
| 41 |
publish_dir: ./doc/_build/dirhtml |