Skip to content

Commit

Permalink
fixn them paths
Browse files Browse the repository at this point in the history
  • Loading branch information
steezeburger committed Aug 16, 2024
1 parent 9e925ee commit 2353ade
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
40 changes: 13 additions & 27 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -62,33 +49,32 @@ 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.
restore-keys: |
${{ 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:
environment:
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
Expand Down
2 changes: 1 addition & 1 deletion web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "export",
basePath: "",
basePath: "/wikipedia-browser",
images: {
unoptimized: true,
},
Expand Down

0 comments on commit 2353ade

Please sign in to comment.