chore(antora): sync script copies supplemental img only; clarify no s… #72
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: Build and Deploy Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| node-version: [20] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| # Omit version: use package.json "packageManager" only (pnpm/action-setup rejects both) | |
| package_json_file: package.json | |
| - name: Set up Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: "pnpm" | |
| cache-dependency-path: "pnpm-lock.yaml" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Antora site | |
| env: | |
| # Antora requires git credentials to be stored in GIT_CREDENTIALS environment variable | |
| # When Antora tries to access a private GitHub repository, it has to make a call to | |
| # using the standard URL format: | |
| # https://<username>:<password>@github.com | |
| # and GitHub specifies using "x-access-token" as the username. For the password, | |
| # we use the Personal Access Token (PAT) saved into the repository's Secrets manager on | |
| # GitHub. In this case, secrets.FTN_GITHUB_TOKEN | |
| GIT_CREDENTIALS: "https://x-access-token:${{ secrets.FTN_GITHUB_TOKEN }}@github.com" | |
| run: pnpm run build | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: build/site | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.ref == 'refs/heads/main' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |