summaryrefslogtreecommitdiffstats
path: root/.github/workflows/docs.yaml
blob: 41adf4e24f7354bdc8218c3624960bdfb6cdad7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Docs

on:
  push:
    branches:
      - master

permissions: {}
jobs:
  build:
    permissions:
      contents: write # to push pages branch (peaceiris/actions-gh-pages)

    runs-on: ubuntu-latest
    steps:
    - name: Setup Python
      uses: actions/setup-python@v2
      with:
        python-version: "3.10"
    - name: Checkout Pygments
      uses: actions/checkout@v2
    - name: Install Sphinx & WCAG contrast ratio
      run: pip install Sphinx wcag-contrast-ratio
    - name: Create Pyodide WASM package
      run: cd doc && make pyodide
    - name: Sphinx build
      run: |
        cd doc
        WEBSITE_BUILD=1 make dirhtml
        touch _build/dirhtml/.nojekyll
        echo -e 'pygments.org\nwww.pygments.org' > _build/dirhtml/CNAME
        echo 'Automated deployment of docs for GitHub pages.' > _build/dirhtml/README
    - name: Deploy to repo
      if: github.repository_owner == 'pygments'
      uses: peaceiris/actions-gh-pages@v3
      with:
        deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
        external_repository: pygments/pygments.github.io
        publish_branch: master
        publish_dir: ./doc/_build/dirhtml