Skip to content

Commit 71a2434

Browse files
Update GitHub Actions workflow for deploying Vite React App to GitHub Pages
1 parent 267fa0a commit 71a2434

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,51 @@
1-
name: Deploy GitHub Pages
1+
name: Deploy Vite React App to GitHub Pages
22

33
on:
44
push:
55
branches: [ "main", "master" ]
6-
pull_request:
7-
branches: [ "main", "master" ]
8-
9-
# Allows you to run this workflow manually from the Actions tab
106
workflow_dispatch:
117

12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
138
permissions:
149
contents: read
1510
pages: write
1611
id-token: write
1712

18-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2013
concurrency:
2114
group: "pages"
2215
cancel-in-progress: false
2316

2417
jobs:
25-
# Build job
2618
build:
2719
runs-on: ubuntu-latest
2820
steps:
2921
- name: Checkout
3022
uses: actions/checkout@v4
31-
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '18'
28+
cache: 'npm'
29+
cache-dependency-path: './spring-scribe-shine-main/package-lock.json'
30+
31+
- name: Install dependencies
32+
run: |
33+
cd spring-scribe-shine-main
34+
npm ci
35+
36+
- name: Build
37+
run: |
38+
cd spring-scribe-shine-main
39+
npm run build
40+
3241
- name: Setup Pages
3342
uses: actions/configure-pages@v4
34-
35-
- name: Build with Jekyll
36-
uses: actions/jekyll-build-pages@v1
37-
with:
38-
source: ./
39-
destination: ./_site
40-
43+
4144
- name: Upload artifact
4245
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: './spring-scribe-shine-main/dist'
4348

44-
# Deployment job
4549
deploy:
4650
environment:
4751
name: github-pages
@@ -52,3 +56,7 @@ jobs:
5256
- name: Deploy to GitHub Pages
5357
id: deployment
5458
uses: actions/deploy-pages@v4
59+
steps:
60+
- name: Deploy to GitHub Pages
61+
id: deployment
62+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)