From 2353ade4a1653316413d63d74054f1795f915542 Mon Sep 17 00:00:00 2001 From: Jesse Snyder Date: Thu, 15 Aug 2024 21:13:01 -0600 Subject: [PATCH] fixn them paths --- .github/workflows/gh-pages.yaml | 40 +++++++++++---------------------- web/next.config.mjs | 2 +- 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml index eda698d..6d11bed 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/gh-pages.yaml @@ -24,36 +24,23 @@ jobs: # Build job build: runs-on: ubuntu-latest - defaults: - run: - working-directory: ./web steps: - name: Checkout uses: actions/checkout@v4 - - name: Detect package manager - id: detect-package-manager + - name: Set package manager + id: set-package-manager run: | - if [ -f "${{ github.workspace }}/yarn.lock" ]; then - echo "manager=yarn" >> $GITHUB_OUTPUT - echo "command=install" >> $GITHUB_OUTPUT - echo "runner=yarn" >> $GITHUB_OUTPUT - exit 0 - elif [ -f "${{ github.workspace }}/package.json" ]; then - echo "manager=npm" >> $GITHUB_OUTPUT - echo "command=ci" >> $GITHUB_OUTPUT - echo "runner=npx --no-install" >> $GITHUB_OUTPUT - exit 0 - else - echo "Unable to determine package manager" - exit 1 - fi + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + echo "runner=npx --no-install" >> $GITHUB_OUTPUT + exit 0 - name: Setup Node uses: actions/setup-node@v4 with: node-version: "lts/*" - cache: ${{ steps.detect-package-manager.outputs.manager }} + cache: ${{ steps.set-package-manager.outputs.manager }} - name: Setup Pages uses: actions/configure-pages@v4 @@ -62,7 +49,7 @@ jobs: uses: actions/cache@v4 with: path: | - .next/cache + ./web/next/cache # Generate a new cache whenever packages or source files change. key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} # If source files changed but packages didn't, rebuild from a prior cache. @@ -70,15 +57,17 @@ jobs: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- - name: Install dependencies - run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + run: ${{ steps.set-package-manager.outputs.manager }} ${{ steps.set-package-manager.outputs.command }} + working-directory: ./web - name: Build with Next.js - run: ${{ steps.detect-package-manager.outputs.runner }} next build + run: ${{ steps.set-package-manager.outputs.runner }} next build + working-directory: ./web - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: ./out + path: ./web/out # Deployment job deploy: @@ -86,9 +75,6 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest - defaults: - run: - working-directory: ./web needs: build steps: - name: Deploy to GitHub Pages diff --git a/web/next.config.mjs b/web/next.config.mjs index d229612..4047ac8 100644 --- a/web/next.config.mjs +++ b/web/next.config.mjs @@ -1,7 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { output: "export", - basePath: "", + basePath: "/wikipedia-browser", images: { unoptimized: true, },