diff --git a/.github/workflows/tyaakobi.yml b/.github/workflows/tyaakobi.yml new file mode 100644 index 0000000..8aeafd6 --- /dev/null +++ b/.github/workflows/tyaakobi.yml @@ -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 diff --git a/node.js/controller/order.js b/node.js/controller/order.js index 40b0114..e284e0b 100644 --- a/node.js/controller/order.js +++ b/node.js/controller/order.js @@ -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); } @@ -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] }); } }); } diff --git a/react/index.html b/react/index.html index 0f83788..6d26ddf 100644 --- a/react/index.html +++ b/react/index.html @@ -4,7 +4,7 @@ - React + קונדיטוריה