feat: add dark mode with toggle button in navbar #24
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: | |
| package_json_file: 'site/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: 'site/pnpm-lock.yaml' | |
| - name: Install dependencies | |
| working-directory: ./site | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Antora site | |
| working-directory: ./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_ANTORADOCS | |
| GIT_CREDENTIALS: "https://x-access-token:${{ secrets.FTN_GITHUB_TOKEN }}@github.com" | |
| run: pnpm exec antora --stacktrace antora-playbook.yml | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: site/build/site | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |