File tree Expand file tree Collapse file tree 8 files changed +388
-2
lines changed
Expand file tree Collapse file tree 8 files changed +388
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy Vite App to GitHub Pages
2+
3+ on :
4+ push :
5+ branches :
6+ - main # Trigger the workflow when changes are pushed to the main branch
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest # Use an Ubuntu environment
11+
12+ steps :
13+ # 1. Check out the repository code
14+ - name : Checkout code
15+ uses : actions/checkout@v2
16+
17+ # 2. Set up Node.js with the specified version
18+ - name : Set up Node.js
19+ uses : actions/setup-node@v3
20+ with :
21+ node-version : ' 20.x' # Set Node.js version to match your local environment (v20.x)
22+
23+ # 3. Install dependencies using npm
24+ - name : Install dependencies
25+ run : npm install
26+
27+ # 4. Build the Vite project
28+ - name : Build Vite project
29+ run : npm run build
30+
31+ # 5. Deploy to GitHub Pages
32+ - name : Deploy to GitHub Pages
33+ uses : peaceiris/actions-gh-pages@v3
34+ with :
35+ publish_dir : ' ./dist' # Path to the built files
36+ github_token : ${{ secrets.GH_IO_PAT }} # Use your stored PAT for authentication
You can’t perform that action at this time.
0 commit comments