From 5a2a8dc1a71b951d623ea8640caf7d789f807677 Mon Sep 17 00:00:00 2001 From: Carl Gay Date: Sat, 20 Apr 2024 20:06:56 -0400 Subject: [PATCH] automation: deploy docs to dylan-lang.github.io --- .github/workflows/deploy-docs.yml | 59 +++++++++++++++++++++++++++++++ documentation/source/conf.py | 9 +++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/deploy-docs.yml diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..5037b50 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,59 @@ +name: 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 to GitHub Pages + 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