-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04d21d0
commit 425e51b
Showing
1 changed file
with
45 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |