Merge pull request #775 from mk3008/refresh-demo-bundle-24454850042 #203
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 ] | |
| paths: | |
| - 'docs/**' | |
| - '!docs/api/**' | |
| - 'packages/core/src/**' | |
| - 'typedoc.json' | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| - '.github/workflows/docs.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: 'docs' | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build workspace packages | |
| run: | | |
| pnpm --filter rawsql-ts run build | |
| pnpm --filter @rawsql-ts/testkit-core run build | |
| pnpm --filter @rawsql-ts/ztd-cli run build | |
| - name: Build documentation | |
| run: pnpm run docs:build | |
| - name: Commit generated API docs | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| run: | | |
| git config --local user.name "GitHub Actions" | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs/api | |
| if git diff --cached --quiet; then | |
| echo "docs/api is already up to date" | |
| exit 0 | |
| fi | |
| git commit --no-verify -m "docs: refresh API reference [skip ci]" | |
| if git push; then | |
| echo "docs: pushed API reference updates" | |
| else | |
| echo "docs: failed to push API reference updates; please push manually if needed" >&2 | |
| fi | |
| - name: Upload static site | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/.vitepress/dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |