Skip to content

Commit ac21f8a

Browse files
Merge pull request #22 from ossdaiict/aditya/feature
feat:deployment issues fixed
2 parents c47eab5 + eeaf7e7 commit ac21f8a

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
cache: 'npm'
22+
cache-dependency-path: './Slot-Booking-System-Frontend/package-lock.json'
23+
24+
- name: Install dependencies
25+
run: |
26+
cd Slot-Booking-System-Frontend
27+
npm ci
28+
29+
- name: Build
30+
run: |
31+
cd Slot-Booking-System-Frontend
32+
npm run build
33+
34+
- name: Deploy to GitHub Pages
35+
uses: peaceiris/actions-gh-pages@v3
36+
if: github.ref == 'refs/heads/main'
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: ./Slot-Booking-System-Frontend/dist

Slot-Booking-System-Frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"private": true,
44
"version": "0.0.0",
55
"type": "module",
6+
"homepage": "https://ossdaiict.github.io/SLoP5.0-Slot-Booking-System/",
67
"scripts": {
78
"dev": "vite",
89
"build": "vite build",
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>slot-booking-system</title>
8+
<script type="text/javascript">
9+
// Single Page Apps for GitHub Pages
10+
// MIT License
11+
// https://github.com/rafgraph/spa-github-pages
12+
// This script takes the current url and converts the path and query
13+
// string into just a query string, and then redirects the browser
14+
// to the new url with only a query string and hash fragment,
15+
// e.g. https://www.foo.tld/one/two?a=b&c=d#qwe, becomes
16+
// https://www.foo.tld/?/one/two&a=b~and~c=d#qwe
17+
// Note: this 404.html file must be at least 512 bytes for it to work
18+
// with Internet Explorer (it is currently > 512 bytes)
19+
20+
// If you're creating a Project Pages site and NOT using a custom domain,
21+
// then set pathSegmentsToKeep to 1 (enterprise users may need to set it to > 1).
22+
// This way the code will only replace the route part and not the real directory.
23+
// This script should be placed right before the closing </head> tag.
24+
25+
(function(l) {
26+
if (l.search[1] === '/' ) {
27+
var decoded = l.search.slice(1).split('&').map(function(s) {
28+
return s.replace(/~and~/g, '&')
29+
}).join('?');
30+
window.history.replaceState(null, null,
31+
l.pathname.slice(0, -1) + decoded + l.hash
32+
);
33+
}
34+
}(window.location))
35+
</script>
36+
</head>
37+
<body>
38+
<div id="root"></div>
39+
<script type="module" src="/src/main.jsx"></script>
40+
</body>
41+
</html>
42+
43+

Slot-Booking-System-Frontend/vite.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ import tailwindcss from '@tailwindcss/vite'
44
// https://vite.dev/config/
55
export default defineConfig({
66
plugins: [react(), tailwindcss()],
7+
base: '/SLoP5.0-Slot-Booking-System/',
78
})

0 commit comments

Comments
 (0)