We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9af3fc commit 4b8a610Copy full SHA for 4b8a610
1 file changed
.github/workflows/ci.yml
@@ -54,3 +54,28 @@ jobs:
54
55
- name: Lint
56
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