Skip to content

Commit 62c07c8

Browse files
committed
Refactor GitHub Actions workflow for frontend deployment and update package.json for CI
1 parent 31c972e commit 62c07c8

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

.github/workflows/frontend.yml

+21-14
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,44 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
4-
name: Deploy frontend to Pages
1+
name: Deploy Frontend to Pages
52

63
on:
74
push:
8-
branches: ["main"]
5+
branches:
6+
- main
97
pull_request:
10-
branches: ["main"]
8+
branches:
9+
- main
1110

1211
jobs:
1312
build:
1413
runs-on: ubuntu-latest
15-
1614
defaults:
1715
run:
18-
working-directory: client
16+
working-directory: frontend
1917

2018
steps:
21-
- uses: actions/checkout@v4
22-
- name: Use Node.js
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: "22.x"
26-
- run: npm run build
27-
working-directory: frontend
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build project
31+
run: npm run build
32+
2833
- name: Setup Pages
2934
uses: actions/configure-pages@v5
35+
3036
- name: Upload artifact
3137
uses: actions/upload-pages-artifact@v3
3238
with:
33-
# Upload entire repository
34-
path: "frontend/dist"
39+
# Upload the build output from the "dist" folder
40+
path: dist
41+
3542
- name: Deploy to GitHub Pages
3643
id: deployment
3744
uses: actions/deploy-pages@v4

frontend/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"dev": "vite",
88
"build": "vite build",
99
"preview": "vite preview",
10-
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json"
10+
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
11+
"ci": "npm install"
1112
},
1213
"devDependencies": {
1314
"@sveltejs/vite-plugin-svelte": "^5.0.3",

0 commit comments

Comments
 (0)