Create two doc versions #158
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
name: Documentation | |
on: | |
push: | |
branches: | |
- main | |
- alpha | |
permissions: | |
contents: write | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: [stable, alpha] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.9' | |
- name: Upgrade pip | |
run: | | |
# install pip=>20.1 to use "pip cache dir" | |
python3 -m pip install --upgrade pip | |
- name: Install dependencies | |
run: | | |
pip install -r requirements/docs.txt | |
- name: Install netin | |
run: | | |
pip install ./ | |
- name: Build documentation | |
run: | | |
if [ "${{ matrix.version }}" == "main" ]; then | |
sphinx-build -b html docs/source/main build/stable | |
elif [ "${{ matrix.version }}" == "alpha" ]; then | |
sphinx-build -b html docs/source/alpha build/alpha | |
fi | |
- name: Deploy to GitHub Pages | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build/${{ matrix.version }} | |
publish_branch: documentation | |