please #9
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: Deploy docs | |
on: | |
push: | |
branches: main | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Nox | |
run: pip install nox | |
- name: Run pdoc | |
timeout-minutes: 1 | |
run: nox --session pdoc -- --output-directory docs/api/ | |
# TODO: move this into a separate repo or something, and use the actual hexdoc.yml action | |
- name: Generate demo book | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
nox --session hexdoc -- ci build --no-release | |
nox --session dummy_setup | |
nox --session dummy_hexdoc -- build | |
nox --session dummy_hexdoc -- merge | |
mv .hexdoc/dummy_book/_site/dst/docs docs/demo | |
- name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs/ | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deploy-pages.outputs.page_url }} | |
steps: | |
- id: deploy-pages | |
uses: actions/deploy-pages@v3 |