Skip to content

Commit bdd2b51

Browse files
committed
ci: add GitHub Action to automatically build and deploy to GitHub Pages
1 parent abf64f1 commit bdd2b51

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/github-pages.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build and Publish
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- name: Setup Node.js environment
17+
uses: actions/setup-node@v3.9.1
18+
with:
19+
node-version: 20.x
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4.1.0
23+
with:
24+
# Version of pnpm to install
25+
version: latest
26+
27+
- name: Install Dependencies
28+
run: pnpm install
29+
30+
- name: Upload Artefact
31+
uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: dist/
34+
35+
deploy:
36+
needs: build
37+
38+
permissions:
39+
pages: write
40+
id-token: write
41+
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)