Skip to content

Commit

Permalink
Merge branch 'main' of github.com:WBG-Coach/coach-admin-sl
Browse files Browse the repository at this point in the history
  • Loading branch information
Janderson Souza Matias authored and Janderson Souza Matias committed Nov 15, 2023
2 parents d9ddea4 + a6eb897 commit a25df85
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 21 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,30 @@ jobs:
build:
name: Deploy to server
runs-on: ubuntu-latest
env:
VITE_API_URL: https://coachdigital.org/sl/api/
BASE_URL: /sl/admin/
steps:
- name: executing remote ssh commands using ssh key
uses: appleboy/[email protected]
- name: 🛎️ Checkout
uses: actions/checkout@v3

- name: 🛠️ Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: 🛠️ Install dependencies
run: npm install

- name: 🚀 Build
run: npm run build

- name: 🕵🏻 Copy file via ssh key
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
cd containers/coach-admin-sl
git pull
sudo docker build -t coach-admin-sl .
sudo docker-compose up -d
source: "dist"
target: "/usr/share/nginx/html/sl/admin"
strip_components: 1
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="https://coachdigital.org/favicon.ico" />
<link rel="icon" type="image/svg+xml" href="/src/images/logos/CoachLogo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Coach SL</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layouts/ProtectedLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const ProtectedLayout = () => {
const navigate = useNavigate();

useEffect(() => {
if (!user) navigate('/login');
if (!user) navigate('/sl/admin/login');
}, [user, navigate]);

const flexDir = useBreakpointValue({ base: 'column', md: 'row' }) as 'column' | 'row';
Expand Down
14 changes: 7 additions & 7 deletions src/components/Navbar/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ export const MenuItems = [
{
icon: 'chart-line',
label: 'dashboard',
route: '/',
route: '/sl/admin/',
},
{
label: 'questionnaire',
subItems: [
{
icon: 'document-layout-right',
label: 'teaching-practices',
route: '/teaching-practices',
route: '/sl/admin/teaching-practices',
},
{
icon: 'clipboard-notes',
label: 'coaching-sessions',
route: '/coaching-sessions',
route: '/sl/admin/coaching-sessions',
},
],
},
Expand All @@ -25,22 +25,22 @@ export const MenuItems = [
{
icon: 'university',
label: 'schools',
route: '/schools',
route: '/sl/admin/schools',
},
{
icon: 'calender',
label: 'coaches-over-time',
route: '/coach-over-time',
route: '/sl/admin/coach-over-time',
},
{
icon: 'folder',
label: 'session-data',
route: '/session-data',
route: '/sl/admin/session-data',
},
{
icon: 'sync',
label: 'syncs',
route: '/syncs',
route: '/sl/admin/syncs',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const UserCard: React.FC<Props> = ({ name, email, logout }) => {
}, [name]);

const handleSettings = () => {
navigate("/settings");
navigate("/sl/admin/settings");
};

return (
Expand Down
6 changes: 3 additions & 3 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export const Router = () => {
<Routes location={location} key={location.pathname}>
{!user ? (
<>
<Route path="/" element={<Login />} />
<Route path="/sl/admin" element={<Login />} />
</>
) : (
<Route path="/" element={<ProtectedLayout />}>
<Route path="/sl/admin" element={<ProtectedLayout />}>
<Route index element={<DashboardPage />} />
<Route path="teaching-practices" element={<CompetenciesPage />} />
<Route path="coaching-sessions" element={<SessionsPage />} />
Expand All @@ -41,7 +41,7 @@ export const Router = () => {
<Route path="syncs" element={<SyncsPage />} />
</Route>
)}
<Route path="*" element={<Navigate to="/" replace />} />
<Route path="*" element={<Navigate to="/sl/admin" replace />} />
</Routes>
</AnimatePresence>
);
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
"allowSyntheticDefaultImports": true,
"outDir": "dist"
},
"include": ["vite.config.ts"]
}
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
base: '/sl/admin/',
plugins: [react()],
resolve: {
alias: [{ find: "@", replacement: path.resolve(__dirname, "src") }],
Expand Down

0 comments on commit a25df85

Please sign in to comment.