fnm 부터 왜 다시 해야 하는 거야?? 이해 안 됨..;; #44
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: | | |
| cd ${{ secrets.EC2_PROJECT_PATH }} | |
| git pull origin main | |
| node -v | |
| npm -v | |
| sudo apt-get install -y unzip | |
| sudo apt-get install -y curl | |
| curl -o- https://fnm.vercel.app/install | bash | |
| source ~/.bashrc | |
| fnm install 22 | |
| node -v | |
| npm -v | |
| source ~/.bashrc | |
| corepack enable pnpm | |
| npm install -g pnpm | |
| source ~/.bashrc | |
| pnpm install | |
| pnpm run build | |
| pm2 reload the-first-take || pm2 start "pnpm run start" --name the-first-take |