Skip to content

Commit 3e53d9e

Browse files
committed
Add GitHub Actions workflow for deploying to GitHub Pages
- Created a new workflow to automate deployment to GitHub Pages on push to the main branch or via manual trigger. - Configured build and deploy jobs, including steps for checking out code, setting up Node.js, installing dependencies, building the project, and deploying the generated artifacts.
1 parent d740c47 commit 3e53d9e

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/pages.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: '20'
27+
28+
- run: npm install
29+
30+
- run: node scripts/build.cjs
31+
32+
- uses: actions/upload-pages-artifact@v3
33+
with:
34+
path: dist
35+
36+
deploy:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: github-pages
41+
url: ${{ steps.deployment.outputs.page_url }}
42+
steps:
43+
- id: deployment
44+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)