Skip to content

Commit

Permalink
👷 add docs CI
Browse files Browse the repository at this point in the history
  • Loading branch information
techouse committed May 8, 2024
1 parent 8863cf6 commit 2cf6de5
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Docs

on:
workflow_dispatch:
branches:
- main
workflow_call:

permissions:
contents: write

jobs:
docs:
name: "Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"
- name: Install package
run: pip install -e .
- name: Install Sphinx dependencies
working-directory: docs
run: pip install -r requirements.txt
- name: Sphinx build
working-directory: docs
run: sphinx-build . _build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/
force_orphan: true
15 changes: 13 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ defaults:
permissions: read-all

jobs:
build-and-publish:
test:
uses: ./.github/workflows/test.yml
secrets: inherit
publish:
needs: test
name: "Publish"
runs-on: ubuntu-latest
environment:
name: pypi
Expand Down Expand Up @@ -99,9 +104,15 @@ jobs:
rm -rf dist
rm -rf $CHANGELOG_PATH
docker:
needs: build-and-publish
needs: [ test, publish ]
permissions:
packages: write
contents: read
uses: ./.github/workflows/docker.yml
secrets: inherit
docs:
uses: ./.github/workflows/docs.yml
needs: [ test, publish ]
permissions:
contents: write
secrets: inherit
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
pull_request:
branches:
- master
workflow_call:
defaults:
run:
shell: bash
permissions: read-all

jobs:
analyze:
name: "Analyze"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -28,6 +30,7 @@ jobs:
- name: Run static analysis
run: tox -e linters
test:
name: "Test"
needs: analyze
runs-on: ubuntu-latest
strategy:
Expand Down

0 comments on commit 2cf6de5

Please sign in to comment.