Skip to content

Commit

Permalink
Update docs.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
divakaivan authored Jul 8, 2024
1 parent 04d21d0 commit 425e51b
Showing 1 changed file with 45 additions and 12 deletions.
57 changes: 45 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,51 @@
name: Deploy Sphinx documentation to Pages
name: GitHub Pages

on:
push:
branches: [master] # branch to trigger deployment
branches:
- main
pull_request:

jobs:
pages:
runs-on: ubuntu-20.04
deploy:
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- id: deployment
uses: sphinx-notes/pages@v3
with:
publish: false
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ steps.deployment.outputs.artifact }}
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./requirements.txt

- run: mkdocs build

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site

0 comments on commit 425e51b

Please sign in to comment.