docs(ci): publish docs via GitHub Pages actions #2
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: GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "docs/**" | |
| - ".github/workflows/gh-pages.yml" | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| cache-dependency-path: docs/pnpm-lock.yaml | |
| - name: 📦 Install Dependencies | |
| working-directory: docs | |
| run: pnpm install --frozen-lockfile | |
| - name: 🌌 Build Valaxy Docs | |
| working-directory: docs | |
| run: pnpm build | |
| - name: 🏷️ Write CNAME | |
| working-directory: docs | |
| run: | | |
| echo "sts2-ritsulib.ritsukage.com" > dist/CNAME | |
| - name: ⚙️ Configure Pages | |
| uses: actions/configure-pages@v5 | |
| - name: ⬆️ Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/dist | |
| - name: 🚀 Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |