Skip to content

Commit

Permalink
using doc-build
Browse files Browse the repository at this point in the history
  • Loading branch information
FerdinandSu committed Nov 4, 2024
1 parent c87515c commit 7786b62
Showing 1 changed file with 38 additions and 20 deletions.
58 changes: 38 additions & 20 deletions .github/workflows/sphinx-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,59 @@
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package
name: Build Python Sphinx Docs

on:
workflow_dispatch: {}
release:
types: [published]

# 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

jobs:
deploy:

jobs:
docs:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/PyMobileSuit
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
working-directory: ./src/
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
pip install -r docs/requirements.txt
pip install poetry
cd src
poetry install
- name: Build Docs
run: |
sphinx-apidoc -o source ../src/ReFreSH/
sphinx-build -b html . build
working-directory: ./docs/
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
packages-dir: ./src/dist
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# Upload entire repository
path: 'docs/build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 7786b62

Please sign in to comment.