Skip to content

Commit

Permalink
Update static.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
EliHei2 authored Sep 12, 2024
1 parent 103f8d0 commit ef9cfc1
Showing 1 changed file with 8 additions and 30 deletions.
38 changes: 8 additions & 30 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Deploy MkDocs to GitHub Pages
on:
push:
branches: ["main"]

workflow_dispatch:

permissions:
Expand All @@ -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 }}

0 comments on commit ef9cfc1

Please sign in to comment.