Merge pull request #63 from DCODE-HQ/AdityaInnovates-patch-2 #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to EC2 | |
| on: | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Add SSH key | |
| uses: webfactory/ssh-agent@v0.7.0 | |
| with: | |
| ssh-private-key: ${{ secrets.EC2_SSH_KEY }} | |
| - name: Deploy on EC2 | |
| run: | | |
| ssh -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} << 'EOF' | |
| cd /home/ubuntu/DevClub/DCODE-CURRENT/DCODE-platform | |
| git pull origin main | |
| yarn | |
| yarn build | |
| pm2 restart DCODE_BETA_FRONTEND | |
| EOF |