Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Youn-Rha authored Nov 15, 2024
1 parent 73f5e7d commit fe1cb12
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ jobs:
npm install
npm run build
# 서버에서 기존 dist 디렉터리 삭제
- name: Remove existing dist directory on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
sudo rm -rf /var/www/html/dist
sudo mkdir -p /var/www/html/dist
sudo chmod -R 755 /var/www/html/dist
# 빌드 파일을 서버로 전송
- name: Copy build directory to server
uses: appleboy/scp-action@master
Expand All @@ -46,13 +59,14 @@ jobs:
source: "./dist/*"
target: "/var/www/html/dist"

# 원격 서버에서 Nginx 재시작
- name: Restart Nginx on server
# 복사한 파일 권한 설정 및 Nginx 재시작
- name: Set permissions and restart Nginx on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
sudo chmod -R 755 /var/www/html/dist
sudo service nginx restart

0 comments on commit fe1cb12

Please sign in to comment.