Skip to content

Commit 4b8a610

Browse files
committed
chore: sync all changes
1 parent b9af3fc commit 4b8a610

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,28 @@ jobs:
5454

5555
- name: Lint
5656
run: npm run lint
57+
58+
deploy:
59+
runs-on: ubuntu-latest
60+
needs: backend
61+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
62+
63+
steps:
64+
- uses: actions/checkout@v3
65+
66+
- name: Deploy to EC2
67+
uses: appleboy/ssh-action@v1.0.0
68+
with:
69+
host: ${{ secrets.EC2_HOST }}
70+
username: ${{ secrets.EC2_USER }}
71+
key: ${{ secrets.EC2_KEY }}
72+
script: |
73+
if [ ! -d "/home/ubuntu/Zappify" ]; then
74+
git clone https://github.com/Mishra-coder/Zappify.git /home/ubuntu/Zappify
75+
fi
76+
cd /home/ubuntu/Zappify
77+
git pull origin main
78+
cd backend
79+
npm install --production
80+
pm2 restart zappify-backend || pm2 start server.js --name zappify-backend
81+
pm2 save

0 commit comments

Comments
 (0)