This commit is contained in:
parent
b69aa6ee27
commit
5fa7ed9c3c
1 changed files with 4 additions and 7 deletions
|
|
@ -15,15 +15,13 @@ jobs:
|
|||
- name: Install rsync
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y rsync openssh-client
|
||||
# act 내부 컨테이너와 호스트 간의 workspace 권한 불일치 방지
|
||||
chown -R $(id -u):$(id -g) $GITHUB_WORKSPACE
|
||||
|
||||
- name: Setup SSH Key
|
||||
run: |
|
||||
# 격리된 임시 보안 디렉토리에 SSH 키 생성 (컨테이너 이탈 방지)
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
|
|
@ -32,10 +30,9 @@ jobs:
|
|||
|
||||
- name: Deploy
|
||||
run: |
|
||||
# dist 폴더 경로를 $GITHUB_WORKSPACE 기준으로 절대 경로 명시
|
||||
rsync -avz --delete -e "ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no" "$GITHUB_WORKSPACE/dist/" imnyang@10.11.8.101:/var/static/imnya.ng/
|
||||
rsync -avz --delete -e "ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no" "$GITHUB_WORKSPACE/dist/" imnyang@10.11.8.101:/var/static/imnya.ng/
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf ~/.ssh/id_rsa
|
||||
rm -rf ~/.ssh/id_ed25519
|
||||
Loading…
Add table
Add a link
Reference in a new issue