From 19bf91878c1bfe905c09bd5451c51d4c406babaf Mon Sep 17 00:00:00 2001 From: Bruno Blais Date: Sat, 25 Nov 2023 22:15:58 -0500 Subject: [PATCH] Tentative deploy to github.io Commit adds a tentative deployment to a github.io page which does not exist at the current moment through means of a github actions. The YML specification is relatively simple. The only manual component is that the sphinx version is specified "hard-coded" within the action file to ensure that the requirements can then be fully installed dynamically. --- .github/workflows/doc-github-pages.yml | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/doc-github-pages.yml diff --git a/.github/workflows/doc-github-pages.yml b/.github/workflows/doc-github-pages.yml new file mode 100644 index 00000000..de7b1f9c --- /dev/null +++ b/.github/workflows/doc-github-pages.yml @@ -0,0 +1,49 @@ +name: Publish doc to GitHub Pages + +on: push + +# Cancels running instances when a pull request is updated by a commit +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }} + cancel-in-progress: true + +env: + SPHINX_VERSION: 4.5.0 + +jobs: + doc: + name: Publish doc to GitHub Pages + runs-on: ubuntu-latest + + steps: + - uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Sphinx + run: | + #If additional sphinx dependencies are required they can be added here relatively easily. + #e.g. if I wanted to have the copybutton for example, I would add: pip install sphinx-copybutton + pip install sphinx==${{ env.SPHINX_VERSION }} + pip install -r doc/requirements.txt + + - name: Build HTML + run: | + cd doc + make html + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: html-doc + path: doc/build/html/ + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@4.1.7 + if: github.ref == 'refs/heads/master' + with: + branch: gh-pages + folder: doc/build/html