From e8c7dea6c4c774bef1c5a0762e4e3a31b5d71185 Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Thu, 13 Feb 2025 19:01:11 +0100 Subject: [PATCH] Update nextjs.yml --- .github/workflows/nextjs.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml index 1615ea9..94e7968 100644 --- a/.github/workflows/nextjs.yml +++ b/.github/workflows/nextjs.yml @@ -18,8 +18,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v4 + - name: Detect package manager id: detect-package-manager run: | @@ -37,42 +38,45 @@ jobs: echo "Unable to determine package manager" exit 1 fi - - name: Setup Node + + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" cache: ${{ steps.detect-package-manager.outputs.manager }} cache-dependency-path: web/package-lock.json - - name: Setup Pages + + - name: Setup GitHub Pages uses: actions/configure-pages@v5 with: static_site_generator: next + - name: Restore cache uses: actions/cache@v4 with: - path: | - web/.next/cache + path: web/.next/cache key: ${{ runner.os }}-nextjs-${{ hashFiles('web/package-lock.json') }}-${{ hashFiles('web/**.[jt]s', 'web/**.[jt]sx') }} restore-keys: | ${{ runner.os }}-nextjs- + - name: Install dependencies run: | cd web ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} - - name: Build with Next.js + + - name: Build Next.js project run: | cd web ${{ steps.detect-package-manager.outputs.runner }} next build - - name: Static HTML export with Next.js - run: | - cd web ${{ steps.detect-package-manager.outputs.runner }} next 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 + + - name: Upload artifact to GitHub Pages uses: actions/upload-pages-artifact@v3 with: path: web/out @@ -87,4 +91,3 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 -