Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/tyaakobi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to EC2

on:
push:
branches:
- tamar_yaakobi

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Connect and deploy
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.EC2_HOST_TYAAKOBI }}
username: ${{ secrets.EC2_USER_TYAAKOBI }}
key: ${{ secrets.EC2_SSH_KEY_TYAAKOBI }}
script: |
cd ~/KonditoriaApp
git pull origin tamar_yaakobi

cd react
npm install
npm run build
sudo cp -r dist/* /var/www/html/

cd ../node.js
npm install

sudo systemctl restart bakery.service
4 changes: 2 additions & 2 deletions node.js/controller/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exports.getByUserId = (req, res) => {
const userOrders = orders.filter(o => o.userId === userId);

if (userOrders.length === 0) {
res.status(404).send("לא נמצאו הזמנות למשתמש זה");
res.status(404).send("לא נמצאו הזמנות למשתמש זה.");
} else {
res.send(userOrders);
}
Expand Down Expand Up @@ -107,7 +107,7 @@ exports.delete = (req, res) => {
if (err) {
res.status(500).send("שגיאה במחיקת ההזמנה");
} else {
res.send({ message: "הזמנה נמחקה בהצלחה", deleted: deleted[0] });
res.send({ message: "ההזמנה נמחקה בהצלחה", deleted: deleted[0] });
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion react/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title> React</title>
<title> קונדיטוריה</title>
</head>
<body>
<div id="root"></div>
Expand Down