Skip to content

Commit c76b5ac

Browse files
authored
Feat(main.yml): Deployment setting
1 parent 26164fe commit c76b5ac

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/main.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy to Server
2+
3+
# main 브랜치로 푸시할 때 이 워크플로우 실행
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# GitHub에서 리포지토리 코드를 가져오는 단계
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
# 서버로 SSH 연결을 통한 배포
19+
- name: Deploy to server via SSH
20+
uses: appleboy/ssh-action@master
21+
with:
22+
host: ${{ secrets.SERVER_HOST }}
23+
username: ${{ secrets.SERVER_USER }}
24+
key: ${{ secrets.SERVER_SSH_KEY }}
25+
script: |
26+
cd /ArWebAuth/
27+
git pull origin main
28+
npm install
29+
pm2 restart www

0 commit comments

Comments
 (0)