Skip to content

Commit

Permalink
ci: update file
Browse files Browse the repository at this point in the history
  • Loading branch information
GitJIHO authored Nov 16, 2024
1 parent 2dd0537 commit 8e7ff78
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,22 @@ jobs:

- name: 📝 Add SSH Host Key
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
cat ~/.ssh/known_hosts
cat ~/.ssh/known_hosts # Add this for debugging to ensure key is correctly added
- name: 📂 Create Directory on Server
run: |
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null jiho99322@${{ secrets.SERVER_IP }} "mkdir -p /var/www/html/dist"
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=~/.ssh/known_hosts jiho99322@${{ secrets.SERVER_IP }} "mkdir -p /var/www/html/dist"
- name: 📤 Copy Files to Server
run: |
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null jiho99322@${{ secrets.SERVER_IP }} "scp -r dist/* jiho99322@${{ secrets.SERVER_IP }}:/tmp/"
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=~/.ssh/known_hosts -r dist/* jiho99322@${{ secrets.SERVER_IP }}:/tmp/
- name: ⚙️ Move Files to Target Directory and Set Permissions
run: |
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null jiho99322@${{ secrets.SERVER_IP }} "sudo mv /tmp/* /var/www/html/dist/ && sudo chmod -R 755 /var/www/html/dist"
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=~/.ssh/known_hosts jiho99322@${{ secrets.SERVER_IP }} "sudo mv /tmp/* /var/www/html/dist/ && sudo chmod -R 755 /var/www/html/dist"
- name: 🔄 Restart Nginx on Server
run: |
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null jiho99322@${{ secrets.SERVER_IP }} "sudo systemctl restart nginx"
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=~/.ssh/known_hosts jiho99322@${{ secrets.SERVER_IP }} "sudo systemctl restart nginx"

0 comments on commit 8e7ff78

Please sign in to comment.