-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: github actions CI/CD & slack 이벤트 중복처리
- Loading branch information
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Deploy to EC2 | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.EC2_KEY }} | ||
|
||
- name: Deploy to EC2 | ||
env: | ||
EC2_HOST: ${{ secrets.EC2_HOST }} | ||
EC2_USER: ${{ secrets.EC2_USER }} | ||
run: | | ||
ssh -o StrictHostKeyChecking=no $EC2_USER@$EC2_HOST << 'EOF' | ||
cd /home/ubuntu # 프로젝트 디렉토리로 이동 | ||
git pull origin master # 최신 코드 가져오기 | ||
npm install # 의존성 설치 | ||
pm2 restart all # PM2로 애플리케이션 재실행 | ||
EOF |
This file contains 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
This file contains 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