feat: add full GitHub Actions support with permissions, environment, … #7
This file contains hidden or 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: docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| ci_gate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - uses: actions/checkout@v4 | |
| - name: Wait for CI checks to complete | |
| uses: actions/github-script@v7 | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Deploy to GitHub Pages | |
| uses: actions/deploy-pages@v4 | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Install root deps (if any) | |
| run: | | |
| pnpm install --frozen-lockfile || pnpm install | |
| - name: Build docs (if present) | |
| run: | | |
| set -e | |
| if [ -f docs/package.json ]; then | |
| cd docs | |
| pnpm install --frozen-lockfile || pnpm install | |
| if pnpm run -s build; then | |
| echo "Docs built with pnpm" | |
| elif npm run build; then | |
| echo "Docs built with npm" | |
| else | |
| echo "Docs build script not found" >&2 | |
| exit 1 | |
| fi | |
| if [ ! -d dist ]; then | |
| echo "Docs build output not found at dist/" >&2 | |
| exit 1 | |
| fi | |
| else | |
| echo "docs/package.json not found; docs site missing" >&2 | |
| exit 1 | |
| fi | |
| - name: Verify docs output exists | |
| run: | | |
| if [ ! -d docs/dist ]; then | |
| echo "Docs build output not found at docs/dist" >&2 | |
| exit 1 | |
| fi | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 |