Skip to content

Commit efbdd2e

Browse files
committed
added gh auto deploy
1 parent a65f11d commit efbdd2e

File tree

6 files changed

+44
-8
lines changed

6 files changed

+44
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy React (frontend) to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
defaults:
13+
run:
14+
working-directory: frontend
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 18
24+
25+
- name: Install dependencies
26+
run: npm install
27+
28+
- name: Build
29+
run: npm run build
30+
31+
- name: Deploy to GitHub Pages
32+
uses: peaceiris/actions-gh-pages@v3
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: ./frontend/build

frontend/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
"start": "react-scripts start",
2222
"build": "react-scripts build",
2323
"test": "react-scripts test",
24-
"eject": "react-scripts eject"
24+
"eject": "react-scripts eject",
25+
26+
"predeploy": "npm run build",
27+
"deploy": "gh-pages -d build"
2528
},
2629
"eslintConfig": {
2730
"extends": [

frontend/src/components/clock/ClockGrid.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function ClockGrid(props) {
3636
}
3737
}
3838

39-
console.log(gridSize);
39+
//console.log(gridSize);
4040
// eslint-disable-next-line react-hooks/exhaustive-deps
4141
}, [isSecondsEnabled, isSeparatorsEnabled, isMobile, isTablet]);
4242

@@ -61,7 +61,7 @@ function ClockGrid(props) {
6161
isVertical: isTablet,
6262
}));
6363
//setIsServerErrorWindowVisible(false);
64-
console.log("Websocket connected, subscribe message sent");
64+
//console.log("Websocket connected, subscribe message sent");
6565
};
6666

6767
socket.onmessage = (event) => {
@@ -107,9 +107,9 @@ function ClockGrid(props) {
107107
const errorCodes = [1002, 1006, 1008, 1009, 1011, 1015];
108108
if(errorCodes.includes(event.code)) {
109109
handleError();
110-
console.log("WebSocket closed with error: " + event.code);
110+
//console.log("WebSocket closed with error: " + event.code);
111111
}
112-
console.log("WebSocket closed: " + event.code);
112+
//console.log("WebSocket closed: " + event.code);
113113
};
114114

115115
return () => {

frontend/src/components/contexts/ThemeContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function ThemeProvider({ children }) {
5252
]);
5353

5454
function saveColorThemeFromContext() {
55-
console.log("Saving theme...", colorTheme);
55+
//console.log("Saving theme...", colorTheme);
5656
saveColorTheme(colorTheme);
5757
}
5858

frontend/src/components/contexts/TimeZoneContext.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export function TimeZoneProvider({ children }) {
2727
}
2828

2929
const data = await response.json();
30-
console.log('data from server:', data);
3130

3231
const deviceZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
3332
const userOffsetSeconds = -new Date().getTimezoneOffset() * 60;

frontend/src/components/contexts/UserContext.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export function UserProvider({ children }) {
7878
const apiResponse = await response.json();
7979

8080
if (apiResponse.success) {
81-
console.log("Theme saved");
8281
return {success: true};
8382
} else {
8483
console.log("Error saving colorTheme");

0 commit comments

Comments
 (0)