-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
1 changed file
with
8 additions
and
30 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 |
---|---|---|
|
@@ -3,7 +3,6 @@ name: Deploy MkDocs to GitHub Pages | |
on: | ||
push: | ||
branches: ["main"] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
|
@@ -20,55 +19,34 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Step 2: Set up Python environment | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
|
||
# Step 3: Install package and set PYTHONPATH | ||
- name: Install package and documentation dependencies | ||
run: | | ||
# export PYTHONPATH=$PYTHONPATH:$(pwd) | ||
pip install -e . | ||
# Step 4: Install MkDocs and required plugins | ||
- name: Install MkDocs and plugins | ||
run: | | ||
pip install mkdocs mkdocs-material mkdocs-autorefs mkdocstrings[python] mkdocs-jupyter pymdown-extensions termynal mkdocs-minify-plugin | ||
# Step 5: Debug environment to check installed packages | ||
- name: Debug environment | ||
run: | | ||
python -m pip freeze | ||
python -m mkdocs --version | ||
# Step 6: Build the MkDocs site with verbose output | ||
- name: Build MkDocs site | ||
run: mkdocs gh-deploy --force | ||
|
||
|
||
# Step 7: Upload the generated site directory as an artifact for GitHub Pages | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: './site' | ||
|
||
run: mkdocs build --verbose | ||
|
||
publish: | ||
needs: [build] | ||
if: contains(github.ref, 'tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build and publish to pypi | ||
uses: JRubics/[email protected] | ||
with: | ||
python_version: "3.10" | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} | ||
- name: Deploy to GitHub Pages | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
mkdocs gh-deploy --force | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} |