docs: rename the commands to be more understandable #22
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: Publish | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'README.md' | |
- 'overrides/**' | |
- 'docs/**' | |
- 'mkdocs.yml' | |
- 'uv.lock' | |
repository_dispatch: | |
types: [build] | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
env: | |
FETCH_SUBMODULE: false # change this to true if you use submodule for the docs | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Install uv | |
uses: astral-sh/setup-uv@v4 | |
with: | |
enable-cache: true | |
cache-dependency-glob: "uv.lock" | |
- name: "Submodule fetching" | |
continue-on-error: true | |
if: ${{ env.FETCH_SUBMODULE == 'true' }} | |
run: | | |
git submodule update --init --recursive --checkout -f --remote -- "docs" | |
git config --global user.name "GitHub Action" | |
git config --global user.email "noreply@github.com" | |
git commit -am "chore (update): fetch submodule" | |
git push | |
- name: Install python | |
run: uv python install | |
- name: Install dependencies | |
run: | | |
uv sync --no-dev | |
- name: Build | |
run: | | |
uv run mkdocs build --clean | |
- name: setup pages | |
id: pages | |
uses: actions/configure-pages@main | |
- name: Upload page artifact | |
uses: actions/upload-pages-artifact@main | |
with: | |
path: ./site | |
deploy: | |
needs: [build] | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to github page | |
id: deployment | |
uses: actions/deploy-pages@main | |