Skip to content

Commit

Permalink
set: app/ as working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
berzanorg committed Oct 10, 2023
1 parent c2124a4 commit b0d111e
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Deploy Next.js site to Pages

defaults:
run:
working-directory: app
on:
# Runs on pushes targeting the default branch
push:
Expand Down Expand Up @@ -34,9 +36,20 @@ jobs:
- name: Detect package manager
id: detect-package-manager
run: |
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
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
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand All @@ -54,7 +67,7 @@ jobs:
uses: actions/cache@v3
with:
path: |
app/.next/cache
.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.
Expand All @@ -69,7 +82,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./app/out
path: ./out

# Deployment job
deploy:
Expand Down

0 comments on commit b0d111e

Please sign in to comment.