feat: add support for GitHub Pages deployment and update navigation l… #1
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
| # Builds website/ as a static Next.js export and publishes to GitHub Pages. | |
| # Repo Settings → Pages → Source: GitHub Actions. | |
| # For project pages, base path is /REPO_NAME (see NEXT_PUBLIC_BASE_PATH below). | |
| name: Deploy website to GitHub Pages | |
| on: | |
| push: | |
| branches: [main, master] | |
| paths: | |
| - 'website/**' | |
| - 'docs/JMockFunction*.json' | |
| - '.github/workflows/deploy-github-pages.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: github-pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| cache-dependency-path: website/package-lock.json | |
| - name: Install dependencies | |
| working-directory: website | |
| run: npm ci | |
| - name: Build static site | |
| working-directory: website | |
| env: | |
| # Project page URL: https://<org>.github.io/<repo>/ | |
| NEXT_PUBLIC_BASE_PATH: /${{ github.event.repository.name }} | |
| run: npm run build | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: website/out | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |