-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Janderson Souza Matias
authored and
Janderson Souza Matias
committed
Nov 21, 2023
1 parent
289fa24
commit 98c556d
Showing
19 changed files
with
219 additions
and
100 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Deploy Sierra Leone | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Deploy to Sierra Leone server | ||
runs-on: ubuntu-latest | ||
env: | ||
DB_HOST: ${{ secrets.DB_HOST }} | ||
DB_PORT: ${{ secrets.DB_PORT }} | ||
DB_USERNAME: ${{ secrets.DB_USERNAME }} | ||
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | ||
DB_DATABASE: ${{ secrets.DB_DATABASE_SL }} | ||
|
||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v1 | ||
|
||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Migrations | ||
run: npm run build | ||
|
||
- name: Run Migrations | ||
run: npm run migration:run | ||
|
||
- name: Copy public folder | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
source: "src,node_modules,build,package.json,Dockerfile,docker-compose-sl.yml" | ||
target: "/home/ubuntu/apps/coach-backend-sl" | ||
|
||
- name: executing remote ssh commands using ssh key | ||
uses: appleboy/ssh-action@v0.1.8 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
script: | | ||
cd /home/ubuntu/apps/coach-backend-sl | ||
sudo docker build -t coach-backend-sl . | ||
sudo docker-compose -f docker-compose-sl.yml up -d |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
import { Application } from "express"; | ||
import Authentication from "../auth/service"; | ||
import CoachController from "./controller"; | ||
import config from "../../config"; | ||
|
||
const coachRouter = (app: Application): void => { | ||
app.post("/sl/api/coach", Authentication.authenticate, CoachController.create); | ||
app.put("/sl/api/coach", Authentication.authenticate, CoachController.update); | ||
app.delete("/sl/api/coach/:id", Authentication.authenticate, CoachController.delete); | ||
app.get("/sl/api/coach/:id", Authentication.authenticate, CoachController.findById); | ||
app.get("/sl/api/coach", Authentication.authenticate, CoachController.findAll); | ||
app.post( | ||
`/${config.country}/api/coach`, | ||
Authentication.authenticate, | ||
CoachController.create | ||
); | ||
app.put( | ||
`/${config.country}/api/coach`, | ||
Authentication.authenticate, | ||
CoachController.update | ||
); | ||
app.delete( | ||
`/${config.country}/api/coach/:id`, | ||
Authentication.authenticate, | ||
CoachController.delete | ||
); | ||
app.get( | ||
`/${config.country}/api/coach/:id`, | ||
Authentication.authenticate, | ||
CoachController.findById | ||
); | ||
app.get( | ||
`/${config.country}/api/coach`, | ||
Authentication.authenticate, | ||
CoachController.findAll | ||
); | ||
}; | ||
|
||
export default coachRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
import { Application } from "express"; | ||
import Authentication from "../auth/service"; | ||
import DashboardController from "./controller"; | ||
import config from "../../config"; | ||
|
||
const dashboardRouter = (app: Application): void => { | ||
app.get( | ||
"/sl/api/dashboard", | ||
`/${config.country}/api/dashboard`, | ||
Authentication.authenticate, | ||
DashboardController.getData | ||
); | ||
app.get( | ||
"/sl/api/dashboard/insert-mock", | ||
// Authentication.authenticate, | ||
DashboardController.insertMock | ||
); | ||
}; | ||
|
||
export default dashboardRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
import { Application } from "express"; | ||
import Authentication from "../auth/service"; | ||
import ImageController from "./controller"; | ||
import config from "../../config"; | ||
|
||
const imageRouter = (app: Application): void => { | ||
app.post("/sl/api/image", Authentication.authenticate, ImageController.create); | ||
app.put("/sl/api/image", Authentication.authenticate, ImageController.update); | ||
app.delete("/sl/api/image/:id", Authentication.authenticate, ImageController.delete); | ||
app.get("/sl/api/image/:id", Authentication.authenticate, ImageController.findById); | ||
app.get("/sl/api/image", Authentication.authenticate, ImageController.findAll); | ||
app.post( | ||
`/${config.country}/api/image`, | ||
Authentication.authenticate, | ||
ImageController.create | ||
); | ||
app.put( | ||
`/${config.country}api/image`, | ||
Authentication.authenticate, | ||
ImageController.update | ||
); | ||
app.delete( | ||
`/${config.country}/api/image/:id`, | ||
Authentication.authenticate, | ||
ImageController.delete | ||
); | ||
app.get( | ||
`/${config.country}/api/image/:id`, | ||
Authentication.authenticate, | ||
ImageController.findById | ||
); | ||
app.get( | ||
`/${config.country}/api/image`, | ||
Authentication.authenticate, | ||
ImageController.findAll | ||
); | ||
}; | ||
|
||
export default imageRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import { Application } from "express"; | ||
import LogsController from "./controller"; | ||
import Authentication from "../auth/service"; | ||
import config from "../../config"; | ||
|
||
const LogRouter = (app: Application): void => { | ||
app.get("/sl/api/logs", Authentication.authenticate, LogsController.findAll); | ||
app.get( | ||
`/${config.country}/api/logs`, | ||
Authentication.authenticate, | ||
LogsController.findAll | ||
); | ||
}; | ||
|
||
export default LogRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.