Skip to content

Commit

Permalink
fix github pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wicksipedia committed Jan 17, 2025
1 parent 7d3ed3a commit 707df23
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Deploy Next.js site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -35,28 +35,31 @@ jobs:
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "✅ Detected yarn"
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/pnpm-lock.yaml" ]; then
echo "✅ Detected pnpm"
echo "manager=pnpm" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=pnpm" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "✅ Detected npm"
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"
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: "${{ github.workspace }}/.nvmrc"
node-version-file: .nvmrc
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup pnpm
if: steps.detect-package-manager.outputs.manager == 'pnpm'
Expand Down

0 comments on commit 707df23

Please sign in to comment.