diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e0c963..f4b4e23 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,31 +1,18 @@ -# Sample workflow for building and deploying a Next.js site to GitHub Pages -# -# To get started with Next.js see: https://nextjs.org/docs/getting-started -# name: Deploy Docs site to Pages on: - # Runs on pushes targeting the default 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 + pull_request: {} + workflow_dispatch: {} permissions: contents: read pages: write id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" - cancel-in-progress: false - + cancel-in-progress: true jobs: - # Build job build: runs-on: ubuntu-latest steps: @@ -48,7 +35,7 @@ jobs: with: node-version: "20" - name: Install pnpm - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v4 with: version: 8 run_install: false @@ -66,20 +53,16 @@ jobs: restore-keys: | ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}- - name: Install dependencies - run: | - cd docs - pnpm install + run: pnpm install - name: Build with Next.js - run: | - cd docs - pnpm run build + run: pnpm run build - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: ./docs/out - - # Deployment job + path: ./out + retention-days: 2 deploy: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} @@ -89,3 +72,5 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }}