diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 3aced0a3..00000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,30 +0,0 @@ -on: - pull_request: - paths: - - 'docs/**' - -jobs: - build: - name: Build doc - runs-on: ubuntu-latest - - steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - - uses: actions/checkout@v4 - with: - lfs: 'true' - - - name: Install pip packages - working-directory: docs - run: | - pip install pip --upgrade - pip install -r requirements.txt --upgrade - - - name: Build doc - working-directory: docs - run: | - make html SPHINXOPTS='-W --keep-going' diff --git a/.github/workflows/main.yml b/.github/workflows/top-level.yml similarity index 63% rename from .github/workflows/main.yml rename to .github/workflows/top-level.yml index 8778ce52..da530f58 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/top-level.yml @@ -4,13 +4,13 @@ on: - main paths: - 'docs/**' + pull_request: + paths: + - 'docs/**' jobs: - build: - name: Deploy doc + build-doc: runs-on: ubuntu-latest - permissions: - contents: write steps: - name: Set up Python @@ -33,23 +33,44 @@ jobs: run: | make html - - name: Commit + - name: Store the generated doc + uses: actions/upload-artifact@v4 + with: + name: html + path: docs/_build/html + + deploy: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + needs: [build-doc] + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + with: + ref: 'gh-pages' + lfs: 'false' + + - name: Empty gh-pages + run: | + git rm -r . --quiet + + - uses: actions/download-artifact@v4 + with: + name: html + + - name: Patch doc build + run: | + rm -r _sources + touch .nojekyll + + - name: Commit gh-pages run: | author=$(git log -1 --pretty=format:'%an') email=$(git log -1 --pretty=format:'%ae') commit=$(git rev-parse --short HEAD) - mkdir /tmp/doc - rm -r docs/_build/html/_sources - cp -r docs/_build/html/* /tmp/doc - git stash --all - git fetch origin gh-pages - git checkout -b gh-pages origin/gh-pages - git rm -r . --quiet - cp -r /tmp/doc/* . - touch .nojekyll - git lfs uninstall - git add . >> /dev/null git config --global user.name "$author" git config --global user.email "$email" @@ -58,7 +79,3 @@ jobs: - name: Push to gh-pages run: >- git push origin gh-pages:gh-pages - - - name: Clean-up - run: >- - rm -r /tmp/doc diff --git a/docs/conf.py b/docs/conf.py index c5a469ce..194a4cc0 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,17 +24,6 @@ # -- Custom extensions configuration ------------------------------------------ -hide_collapsible_content = True -validate_links = False - -pseudo_subdomains = { - 'eval': 'Evaluation Boards', - 'university': 'University Program', -} - # -- Options for HTML output -------------------------------------------------- html_theme = 'cosmic' -html_static_path = ['sources'] -html_css_files = ["custom.css"] -html_favicon = "sources/icon.svg"