|
|
@ -5,37 +5,22 @@ on: |
|
|
|
branches: |
|
|
|
- docstest |
|
|
|
|
|
|
|
permissions: |
|
|
|
contents: write |
|
|
|
|
|
|
|
jobs: |
|
|
|
deploy: |
|
|
|
runs-on: ubuntu-latest # Use Ubuntu as the runner environment |
|
|
|
|
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
# Step 1: Checkout the repository |
|
|
|
- name: Checkout repository |
|
|
|
uses: actions/checkout@v3 |
|
|
|
|
|
|
|
# Step 2: Set up Python environment |
|
|
|
- name: Set up Python |
|
|
|
uses: actions/setup-python@v4 |
|
|
|
with: |
|
|
|
python-version: "3.x" # Specify the Python version |
|
|
|
|
|
|
|
# Step 3: Install MkDocs and dependencies |
|
|
|
- name: Install MkDocs |
|
|
|
- uses: actions/checkout@v4 |
|
|
|
- name: Configure Git Credentials |
|
|
|
run: | |
|
|
|
pip install mkdocs |
|
|
|
pip install mkdocs-material # Optional: MkDocs Material theme |
|
|
|
|
|
|
|
# Step 4: Build and Deploy to GitHub Pages |
|
|
|
- name: Deploy to GitHub Pages |
|
|
|
uses: peaceiris/actions-gh-pages@v3 |
|
|
|
git config user.name github-actions[bot] |
|
|
|
git config user.email 41898282+github-actions[bot]@users.noreply.github.com |
|
|
|
- uses: actions/setup-python@v5 |
|
|
|
with: |
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
publish_dir: ./site # Directory to publish (MkDocs builds here by default) |
|
|
|
# Optional: Add "cname: www.example.com" if using a custom domain |
|
|
|
|
|
|
|
# Step 5: Build MkDocs site |
|
|
|
- name: Build MkDocs site |
|
|
|
run: | |
|
|
|
cd docs |
|
|
|
mkdocs gh-deploy --force |
|
|
|
python-version: 3.x |
|
|
|
- run: pip install -r requirements.txt |
|
|
|
working-directory: ./mkdocs |
|
|
|
- run: mkdocs gh-deploy --force |
|
|
|
working-directory: ./docs |
xxxxxxxxxx