Skip to content

Commit cb5e2f1

Browse files
João Miguel Marinho da CunhaJoão Miguel Marinho da Cunha
authored andcommitted
fix github actions (again?)
1 parent c4ed48f commit cb5e2f1

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

.github/workflows/deploy.yaml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,37 @@ jobs:
3030
steps:
3131
- name: Checkout
3232
uses: actions/checkout@v3
33-
- name: Install deps
34-
run: npm ci
35-
- name: Build Demo
36-
run: npm run build:demo
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
49+
uses: actions/setup-node@v3
50+
with:
51+
node-version: "16"
52+
cache: ${{ steps.detect-package-manager.outputs.manager }}
3753
- name: Setup Pages
3854
uses: actions/configure-pages@v2
55+
- name: Install dependencies
56+
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
57+
- name: Build Demo
58+
run: npm run build:demo
3959
- name: Upload artifact
4060
uses: actions/upload-pages-artifact@v1
4161
with:
4262
# Upload entire repository
43-
path: 'demo'
63+
path: "demo"
4464
- name: Deploy to GitHub Pages
4565
id: deployment
4666
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)