Skip to content

Commit

Permalink
ci: use pnpm, deprecated npm & yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
cdfmlr committed Sep 29, 2024
1 parent 2b4f9df commit 7f2a962
Showing 1 changed file with 10 additions and 37 deletions.
47 changes: 10 additions & 37 deletions .github/workflows/nuxtjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,47 +31,20 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
# https://pnpm.io/continuous-integration#github-actions
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
# - name: Setup Pages
# uses: actions/configure-pages@v5
# with:
# # Automatically inject router.base in your Nuxt configuration file and set
# # target to static (https://nuxtjs.org/docs/configuration-glossary/configuration-target/).
# #
# # You may remove this line if you want to manage the configuration yourself.
# static_site_generator: nuxt
- name: Restore cache
uses: actions/cache@v4
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
path: |
dist
.nuxt
key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }}
restore-keys: |
${{ runner.os }}-nuxt-build-
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
run: pnpm install
- name: Static HTML export with Nuxt
run: ${{ steps.detect-package-manager.outputs.manager }} run generate-static
run: pnpm run generate-static
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down

0 comments on commit 7f2a962

Please sign in to comment.