diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..69cda60 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,32 @@ +name: demo deployement + +on: + push: + branches: [ "main" ] + paths: + - 'client/**' + - 'server/**' + +jobs: + build-and-deploy-client: + name: Build and Deploy Client + runs-on: amazonlinux-2 + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build client + run: | + cd client + npm install --legacy-peer-deps + npm run build + + - name: Deploy client + uses: easingthemes/ssh-deploy@v2 + with: + REMOTE_HOST : ${{ secrets.SERVER_IP }} + REMOTE_USER : ${{ secrets.FE_USER }} + SSH_PRIVATE_KEY : ${{ secrets.EC2_FE_SSH_KEY }} + SOURCE : 'client/build' + TARGET : '/home/hackathon-test' diff --git a/client/src/App.js b/client/src/App.js index 0826353..5be48ed 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -18,7 +18,7 @@ import { AssistantsList, AssistantsChatPage, ChatPage, - AssistantFileDownloadPage, + AssistantFileDownloadPage } from "./Pages"; import Layout from "./Pages/Layout"; diff --git a/server/app.js b/server/app.js index b83dc17..eb4afb8 100644 --- a/server/app.js +++ b/server/app.js @@ -21,7 +21,7 @@ import assistantThreadRouter from './routers/assistantThreadRoutes.js'; import teamRouter from "./routers/teamRoutes.js"; import organizationRouter from "./routers/organizationRoutes.js"; import { errorLogger } from "./middlewares/errorMiddleware.js"; -import { initSetup } from './controllers/initController.js' +import { initSetup } from './controllers/initController.js'; const app = express(); app.use(cors({ @@ -39,6 +39,10 @@ app.get("/", (req, res) => { var upload = multer(); + + + + app.post("/api/init", initSetup); app.use("/api/auth", router); app.use("/api/user", userRouter);