name: Deploy Next.js site to Pages on: push: branches: ["main"] workflow_dispatch: permissions: contents: write pages: write id-token: write concurrency: group: "pages" cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" cache: yarn cache-dependency-path: web/yarn.lock - name: Install dependencies run: | cd web yarn install --frozen-lockfile - name: Build Next.js project run: | cd web yarn build yarn export - name: Copy guides and changelog run: | mkdir -p web/out/guides cp guides/*.md web/out/guides/ cp CHANGELOG.md web/out/ - name: Upload artifact to GitHub Pages uses: actions/upload-pages-artifact@v3 with: path: web/out deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4