File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments