mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-01 10:11:30 +08:00
73 lines
1.6 KiB
YAML
73 lines
1.6 KiB
YAML
name: Docs
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'docs/**'
|
|
- 'mkdocs.yml'
|
|
- 'requirements_dev.txt'
|
|
- '.github/workflows/docs.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'docs/**'
|
|
- 'mkdocs.yml'
|
|
- 'requirements_dev.txt'
|
|
- '.github/workflows/docs.yml'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements_dev.txt
|
|
|
|
- name: Build documentation
|
|
run: mkdocs build
|
|
|
|
- name: Upload site artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gunicorn-site
|
|
path: site
|
|
retention-days: 7
|
|
|
|
deploy:
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements_dev.txt
|
|
|
|
- name: Build documentation
|
|
run: mkdocs build
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: site
|
|
publish_branch: gh-pages
|
|
commit_message: "docs: deploy {sha}"
|