File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy Vite React App to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : ["main"]
6+
7+ permissions :
8+ contents : read
9+ pages : write
10+ id-token : write
11+
12+ jobs :
13+ build :
14+ runs-on : ubuntu-latest
15+
16+ ` ` `
17+ steps:
18+ - name: Checkout
19+ uses: actions/checkout@v4
20+
21+ - name: Setup Node
22+ uses: actions/setup-node@v4
23+ with:
24+ node-version: 20
25+
26+ - name: Install dependencies
27+ run: npm install
28+
29+ - name: Build
30+ run: npm run build
31+
32+ - name: Upload artifact
33+ uses: actions/upload-pages-artifact@v3
34+ with:
35+ path: ./dist
36+ ` ` `
37+
38+ deploy :
39+ needs : build
40+ runs-on : ubuntu-latest
41+
42+ ` ` `
43+ environment:
44+ name: github-pages
45+ url: ${{ steps.deployment.outputs.page_url }}
46+
47+ steps:
48+ - name: Deploy to GitHub Pages
49+ id: deployment
50+ uses: actions/deploy-pages@v4
51+ ` ` `
You can’t perform that action at this time.
0 commit comments