diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..fc51cca --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,59 @@ +name: Build and deploy documentation + +on: + push: + # all branches + paths: + - 'documentation/**' + pull_request: + paths: + - 'documentation/**' + + # This enables the Run Workflow button on the Actions tab. + workflow_dispatch: + +# https://github.com/JamesIves/github-pages-deploy-action#readme +permissions: + contents: write + +# Set DYLAN environment variable to GITHUB_WORKSPACE so packages are +# installed in ../../_packages relative to documentation's Makefile +env: + DYLAN: ${{ github.workspace }} + +jobs: + + build-and-deploy: + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check links + uses: addnab/docker-run-action@v3 + with: + image: ghcr.io/fraya/dylan-docs + options: -v ${{ github.workspace }}/documentation:/docs + run: make linkcheck + + - name: Build docs + uses: addnab/docker-run-action@v3 + with: + image: ghcr.io/fraya/dylan-docs + options: -v ${{ github.workspace }}/documentation:/docs + run: make html + + - name: Upload HTML + uses: actions/upload-artifact@v4 + with: + name: lsp-dylan + path: documentation/build/html/ + + - name: Bypass Jekyll on GH Pages + run: sudo touch documentation/build/html/.nojekyll + + - name: Deploy docs + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: documentation/build/html diff --git a/documentation/source/conf.py b/documentation/source/conf.py index 80d8ba3..3f3c878 100644 --- a/documentation/source/conf.py +++ b/documentation/source/conf.py @@ -56,3 +56,12 @@ # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] + + +# Ignore GitHub source code links with line number anchors in them because +# they're apparently handled via Javascript and won't be found in the HTML. +# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-linkcheck_anchors_ignore +linkcheck_anchors_ignore = [r"^L\d+$"] + +# Ignore certificate verification +tls_verify = False