branding: Logo + favicon #4
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
| # Workflow for building and deploying a VitePress site to GitHub Pages | |
| # | |
| name: Deploy VitePress site to Pages | |
| on: | |
| # Runs on pushes targeting the `main` branch. | |
| push: | |
| branches: [main] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| # Pages must already be enabled on the repository, with Settings > Pages > | |
| # Build and deployment > Source set to "GitHub Actions". This step cannot | |
| # do it: the action's `enablement` option needs a token with admin rights, | |
| # which GITHUB_TOKEN does not have, so asking for it only fails with | |
| # "Resource not accessible by integration". | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Check for custom domain | |
| id: check-domain | |
| run: | | |
| CNAME=$(gh api repos/${{ github.repository }}/pages --jq '.cname // empty') | |
| if [ -n "$CNAME" ]; then | |
| echo "has_custom_domain=true" >> $GITHUB_OUTPUT | |
| echo "Custom domain detected: $CNAME" | |
| else | |
| echo "has_custom_domain=false" >> $GITHUB_OUTPUT | |
| echo "No custom domain set" | |
| fi | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install dependencies and build pages | |
| run: | | |
| npm ci | |
| # Set base path only if no custom domain is configured | |
| if [ "${{ steps.check-domain.outputs.has_custom_domain }}" = "false" ]; then | |
| export VITEPRESS_BASE=/${GITHUB_REPOSITORY#*/}/ | |
| fi | |
| npm run build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| # The build output path is confirmed to be docs/.vitepress/dist | |
| path: docs/.vitepress/dist | |
| # Deployment job | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| needs: build | |
| runs-on: ubuntu-latest | |
| name: Deploy | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |