Skip to content

Commit da1fb2d

Browse files
committed
feat: deploy workflow
1 parent c08f5e5 commit da1fb2d

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Deploy
2+
3+
concurrency:
4+
group: 'deploy'
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches: [ "master" ]
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 5
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- uses: pnpm/action-setup@v4
29+
name: Install pnpm
30+
with:
31+
run_install: false
32+
33+
- name: Setup Node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 20
37+
cache: 'pnpm'
38+
39+
- name: Get pnpm store directory
40+
shell: bash
41+
run: |
42+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
43+
44+
- uses: actions/cache@v4
45+
name: Setup pnpm cache
46+
with:
47+
path: ${{ env.STORE_PATH }}
48+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
49+
restore-keys: |
50+
${{ runner.os }}-pnpm-store-
51+
52+
- name: Install dependencies
53+
run: pnpm install --frozen-lockfile
54+
55+
- name: Build
56+
run: pnpm build
57+
58+
- name: Setup Pages
59+
uses: actions/configure-pages@v4
60+
61+
- name: Upload artifact
62+
uses: actions/upload-pages-artifact@v3
63+
with:
64+
path: './dist'
65+
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
"@solidjs/router": "^0.13.5",
2424
"solid-icons": "^1.1.0",
2525
"solid-js": "^1.8.17"
26-
}
26+
},
27+
"packageManager": "[email protected]"
2728
}

0 commit comments

Comments
 (0)