From 173a7d8a8319e27e0453ab8dd68d4d3a3412ff5f Mon Sep 17 00:00:00 2001 From: Krishnan Shankar Date: Sun, 9 Jun 2024 02:13:52 -0400 Subject: [PATCH] Add deploy-docs workflow for Sphinx -> GitHub Pages deployment --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy-docs.yml | 60 +++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy-docs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c837ad4b..a7432cfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,7 @@ jobs: - name: Run Tests run: pipenv run python3 manage.py test + docs: runs-on: ubuntu-latest @@ -68,6 +69,5 @@ jobs: - name: Build Docs run: | - cd docs pipenv run make html diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 00000000..231d6318 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,60 @@ +name: Deploy docs + +on: + push: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: + - 3.8 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pipenv + + - name: Install Sphinx + run: sudo apt-get install python3-sphinx + + - name: Install pipenv + run: pip install pipenv + + - name: Install dependencies + run: pipenv install --dev + + - name: Build docs + run: | + cd docs + pipenv run make html + + - name: Upload docs artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/build/html + + deploy: + runs-on: ubuntu-latest + needs: build + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + permissions: + pages: write + id-token: write + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4