From 901b35218bfec082344ec31f6375929fbead44a5 Mon Sep 17 00:00:00 2001 From: Ariel Rokem Date: Thu, 31 Oct 2024 11:00:16 -0700 Subject: [PATCH] Update deploy workflow to build and deploy sphinx website. --- .github/workflows/deploy.yml | 70 ++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f2c9e97..a59f524 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,43 +1,43 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages +name: Deploy website -on: - # Runs on pushes targeting the default branch - push: - branches: ["main"] +on: [push, pull_request] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false + contents: write jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + build: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload entire repository - path: '.' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + - name: Checkout repo + uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + - name: Build site + run: | + cd docs + make html + - name: Upload docs + uses: actions/upload-artifact@v4 + with: + name: docs + path: docs/build/html + - name: Publish docs to Github Pages + if: startsWith(github.event.ref, 'refs/tags') + uses: JamesIves/github-pages-deploy-action@releases/v4 + with: + folder: build/html