name: Deploy Documentation
on:
push:
branches: [main]
paths:
- "docs/**"
- "README.md"
- "README_zh.md"
- ".github/workflows/docs.yml"
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup vx
uses: loonghao/vx@main
with:
version: '0.8.0'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup tools (vx)
run: vx setup
- name: Install dependencies
run: vx just docs-install
- name: Build documentation
run: vx just docs-build
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: docs/.vitepress/dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4