Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-755: Interactive Page for Most Frequently Used Vietnamese Words #756

Merged
merged 21 commits into from
Oct 27, 2024
62 changes: 62 additions & 0 deletions .github/workflows/deploy-languages-v2-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy Languages V2 Web
on:
pull_request:
branches: [main]
types:
- labeled
- synchronize

jobs:
build-and-deploy:
name: Build and Deploy
if: ${{ github.event.label.name == 'deploy-languages-v2-web' }}
runs-on: ubuntu-latest
env:
PROJECT_PATH: apps/languagesv2/languages-v2-web
TARGET_PATH: /root/apps
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
working-directory: ${{ env.PROJECT_PATH }}
run: npm install

- name: Build React App
working-directory: ${{ env.PROJECT_PATH }}
run: npm run build

- name: Clean target folder on remote server
uses: appleboy/[email protected]
with:
host: ${{ secrets.UTS_HOST }}
username: ${{ secrets.UTS_USERNAME }}
password: ${{ secrets.UTS_PASSWORD }}
port: ${{ secrets.UTS_PORT }}
script: |
rm -rf ${{ env.TARGET_PATH }}/*

- name: Copy build files via SCP
uses: appleboy/[email protected]
with:
host: ${{ secrets.UTS_HOST }}
username: ${{ secrets.UTS_USERNAME }}
password: ${{ secrets.UTS_PASSWORD }}
port: ${{ secrets.UTS_PORT }}
source: "${{ env.PROJECT_PATH }}/build/*"
target: "${{ env.TARGET_PATH }}"
recursive: true

- name: Clean target folder on remote server
uses: appleboy/[email protected]
with:
host: ${{ secrets.UTS_HOST }}
username: ${{ secrets.UTS_USERNAME }}
password: ${{ secrets.UTS_PASSWORD }}
port: ${{ secrets.UTS_PORT }}
script: |
mv ${{ env.TARGET_PATH }}/${{ env.PROJECT_PATH }}/build/* ${{ env.TARGET_PATH }}/ && rm -rf ${{ env.TARGET_PATH }}/apps
21 changes: 21 additions & 0 deletions apps/languagesv2/languages-v2-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions apps/languagesv2/languages-v2-web/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "languages-v2",
"version": "0.1.0",
"homepage": "./",
"private": true,
"dependencies": {
"@react-oauth/google": "^0.12.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.112",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"font-awesome": "^4.7.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
Expand Down
Binary file modified apps/languagesv2/languages-v2-web/public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion apps/languagesv2/languages-v2-web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Underthesea Languages v2</title>
<title>Underthesea Languages</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
4 changes: 1 addition & 3 deletions apps/languagesv2/languages-v2-web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import './App.css';
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import { Route, Routes } from 'react-router-dom';
import Home from './pages/Home';
import Nav from './pages/Nav';
import Quiz from './pages/Quiz';
Expand All @@ -9,7 +9,6 @@ import Video from './pages/Video';

function App() {
return (
<Router>
<div className="App w-full flex flex-col items-center justify-center min-h-screen bg-gray-100">
<Nav />
<div className="w-4/5">
Expand All @@ -20,7 +19,6 @@ function App() {
</Routes>
</div>
</div>
</Router>
);
}

Expand Down
6 changes: 5 additions & 1 deletion apps/languagesv2/languages-v2-web/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import './index.css';
import 'font-awesome/css/font-awesome.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

Expand All @@ -9,7 +11,9 @@ const root = ReactDOM.createRoot(
);
root.render(
<React.StrictMode>
<App />
<BrowserRouter basename="/app">
<App />
</BrowserRouter>
</React.StrictMode>
);

Expand Down
Loading
Loading