Skip to content

Commit d9c630d

Browse files
authored
GH-755: Interactive Page for Most Frequently Used Vietnamese Words (#756)
1 parent 4c969ab commit d9c630d

24 files changed

+6001
-80
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Deploy Languages V2 Web
2+
on:
3+
pull_request:
4+
branches: [main]
5+
types:
6+
- labeled
7+
- synchronize
8+
9+
jobs:
10+
build-and-deploy:
11+
name: Build and Deploy
12+
if: ${{ github.event.label.name == 'deploy-languages-v2-web' }}
13+
runs-on: ubuntu-latest
14+
env:
15+
PROJECT_PATH: apps/languagesv2/languages-v2-web
16+
TARGET_PATH: /root/apps
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: '20'
24+
25+
- name: Install dependencies
26+
working-directory: ${{ env.PROJECT_PATH }}
27+
run: npm install
28+
29+
- name: Build React App
30+
working-directory: ${{ env.PROJECT_PATH }}
31+
run: npm run build
32+
33+
- name: Clean target folder on remote server
34+
uses: appleboy/[email protected]
35+
with:
36+
host: ${{ secrets.UTS_HOST }}
37+
username: ${{ secrets.UTS_USERNAME }}
38+
password: ${{ secrets.UTS_PASSWORD }}
39+
port: ${{ secrets.UTS_PORT }}
40+
script: |
41+
rm -rf ${{ env.TARGET_PATH }}/*
42+
43+
- name: Copy build files via SCP
44+
uses: appleboy/[email protected]
45+
with:
46+
host: ${{ secrets.UTS_HOST }}
47+
username: ${{ secrets.UTS_USERNAME }}
48+
password: ${{ secrets.UTS_PASSWORD }}
49+
port: ${{ secrets.UTS_PORT }}
50+
source: "${{ env.PROJECT_PATH }}/build/*"
51+
target: "${{ env.TARGET_PATH }}"
52+
recursive: true
53+
54+
- name: Clean target folder on remote server
55+
uses: appleboy/[email protected]
56+
with:
57+
host: ${{ secrets.UTS_HOST }}
58+
username: ${{ secrets.UTS_USERNAME }}
59+
password: ${{ secrets.UTS_PASSWORD }}
60+
port: ${{ secrets.UTS_PORT }}
61+
script: |
62+
mv ${{ env.TARGET_PATH }}/${{ env.PROJECT_PATH }}/build/* ${{ env.TARGET_PATH }}/ && rm -rf ${{ env.TARGET_PATH }}/apps

apps/languagesv2/languages-v2-web/package-lock.json

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/languagesv2/languages-v2-web/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
{
22
"name": "languages-v2",
33
"version": "0.1.0",
4+
"homepage": "./",
45
"private": true,
56
"dependencies": {
7+
"@react-oauth/google": "^0.12.1",
68
"@testing-library/jest-dom": "^5.17.0",
79
"@testing-library/react": "^13.4.0",
810
"@testing-library/user-event": "^13.5.0",
911
"@types/jest": "^27.5.2",
1012
"@types/node": "^16.18.112",
1113
"@types/react": "^18.3.11",
1214
"@types/react-dom": "^18.3.0",
15+
"font-awesome": "^4.7.0",
1316
"react": "^18.3.1",
1417
"react-dom": "^18.3.1",
1518
"react-icons": "^5.3.0",
Binary file not shown.

apps/languagesv2/languages-v2-web/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
work correctly both with client-side routing and a non-root public URL.
2525
Learn how to configure a non-root public URL by running `npm run build`.
2626
-->
27-
<title>Underthesea Languages v2</title>
27+
<title>Underthesea Languages</title>
2828
</head>
2929
<body>
3030
<noscript>You need to enable JavaScript to run this app.</noscript>

apps/languagesv2/languages-v2-web/src/App.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import './App.css';
3-
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
3+
import { Route, Routes } from 'react-router-dom';
44
import Home from './pages/Home';
55
import Nav from './pages/Nav';
66
import Quiz from './pages/Quiz';
@@ -9,7 +9,6 @@ import Video from './pages/Video';
99

1010
function App() {
1111
return (
12-
<Router>
1312
<div className="App w-full flex flex-col items-center justify-center min-h-screen bg-gray-100">
1413
<Nav />
1514
<div className="w-4/5">
@@ -20,7 +19,6 @@ function App() {
2019
</Routes>
2120
</div>
2221
</div>
23-
</Router>
2422
);
2523
}
2624

apps/languagesv2/languages-v2-web/src/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom/client';
3+
import { BrowserRouter } from 'react-router-dom';
34
import './index.css';
5+
import 'font-awesome/css/font-awesome.css';
46
import App from './App';
57
import reportWebVitals from './reportWebVitals';
68

@@ -9,7 +11,9 @@ const root = ReactDOM.createRoot(
911
);
1012
root.render(
1113
<React.StrictMode>
12-
<App />
14+
<BrowserRouter basename="/app">
15+
<App />
16+
</BrowserRouter>
1317
</React.StrictMode>
1418
);
1519

0 commit comments

Comments
 (0)