feat: add security headers and enhance accessibility #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: Docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: docs-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| build: | |
| runs-on: ${{ vars.RUNS_ON || 'ubuntu-latest' }} | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: 11 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| cache-dependency-path: docs/pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm --dir docs install --frozen-lockfile | |
| - name: Build docs | |
| env: | |
| VITEPRESS_SITE_URL: ${{ vars.VITEPRESS_SITE_URL }} | |
| VITEPRESS_BASE: ${{ vars.VITEPRESS_BASE }} | |
| VITEPRESS_GTAG_ID: ${{ vars.VITEPRESS_GTAG_ID }} | |
| run: pnpm --dir docs run build | |
| - name: Configure Pages | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.SKIP_DOCS_DEPLOY != 'true' | |
| uses: actions/configure-pages@v5 | |
| - name: Upload Pages artifact | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.SKIP_DOCS_DEPLOY != 'true' | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: docs/.vitepress/dist | |
| deploy: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.SKIP_DOCS_DEPLOY != 'true' | |
| needs: build | |
| runs-on: ${{ vars.RUNS_ON || 'ubuntu-latest' }} | |
| timeout-minutes: 10 | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |