Merge pull request #35 from SWMTheFirstTake/dev #68
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 # main 브랜치에 푸시될 때 실행 | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to EC2 | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ${{ secrets.EC2_USERNAME }} | |
| key: ${{ secrets.EC2_SSH_KEY }} | |
| script: | | |
| export NEXT_PUBLIC_TFT_BACKEND_URL=${{ secrets.NEXT_PUBLIC_TFT_BACKEND_URL }} | |
| set -e | |
| cd ${{ secrets.EC2_PROJECT_PATH }} | |
| git pull origin main | |
| pnpm install | |
| pnpm run build | |
| pm2 reload the-first-take || pm2 start "pnpm run start" --name the-first-take |