Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ldhapple authored Dec 10, 2024
1 parent 84ba387 commit 070a3ec
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,18 @@ jobs:
npm install
npm run build
# 3. 빌드 파일을 EC2 서버로 전송
# 3. SSH 키 파일 생성
- name: Create SSH Key File
run: |
echo "$KEY" > /tmp/deploy_key.pem
chmod 600 /tmp/deploy_key.pem
env:
KEY: ${{ secrets.FRONTEND_EC2_KEY }}

# 4. 빌드 파일을 EC2 서버로 전송
- name: Upload build files to EC2
run: |
scp -o StrictHostKeyChecking=no -i /tmp/deploy_key.pem -r ./build/* $USER@$HOST:/usr/share/nginx/html
env:
HOST: ${{ secrets.FRONTEND_EC2_HOST }}
USER: ${{ secrets.FRONTEND_EC2_USER }}
KEY: ${{ secrets.FRONTEND_EC2_KEY }}
run: |
scp -o StrictHostKeyChecking=no -i $KEY -r ./build/* $USER@$HOST:/usr/share/nginx/html

0 comments on commit 070a3ec

Please sign in to comment.