Skip to content

Commit 842359d

Browse files
João Miguel Marinho da CunhaJoão Miguel Marinho da Cunha
authored andcommitted
pnpm was not supported in previous action
1 parent cb5e2f1 commit 842359d

File tree

1 file changed

+29
-19
lines changed

1 file changed

+29
-19
lines changed

.github/workflows/deploy.yaml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,47 @@ jobs:
3030
steps:
3131
- name: Checkout
3232
uses: actions/checkout@v3
33-
- name: Detect package manager
34-
id: detect-package-manager
35-
run: |
36-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
37-
echo "::set-output name=manager::yarn"
38-
echo "::set-output name=command::install"
39-
exit 0
40-
elif [ -f "${{ github.workspace }}/package.json" ]; then
41-
echo "::set-output name=manager::npm"
42-
echo "::set-output name=command::ci"
43-
exit 0
44-
else
45-
echo "Unable to determine packager manager"
46-
exit 1
47-
fi
48-
- name: Setup Node
33+
- name: Install Node.js
4934
uses: actions/setup-node@v3
5035
with:
51-
node-version: "16"
52-
cache: ${{ steps.detect-package-manager.outputs.manager }}
36+
node-version: 16
37+
38+
- uses: pnpm/action-setup@v2
39+
name: Install pnpm
40+
id: pnpm-install
41+
with:
42+
version: 7
43+
run_install: false
44+
45+
- name: Get pnpm store directory
46+
id: pnpm-cache
47+
shell: bash
48+
run: |
49+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
50+
51+
- uses: actions/cache@v3
52+
name: Setup pnpm cache
53+
with:
54+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
55+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
56+
restore-keys: |
57+
${{ runner.os }}-pnpm-store-
58+
5359
- name: Setup Pages
5460
uses: actions/configure-pages@v2
61+
5562
- name: Install dependencies
56-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
63+
run: pnpm install
64+
5765
- name: Build Demo
5866
run: npm run build:demo
67+
5968
- name: Upload artifact
6069
uses: actions/upload-pages-artifact@v1
6170
with:
6271
# Upload entire repository
6372
path: "demo"
73+
6474
- name: Deploy to GitHub Pages
6575
id: deployment
6676
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)