Skip to content

Commit

Permalink
fix: ssh 접속 시 password 접근 안 되는 문제를 Key 접근 방식으로 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
dgjinsu committed Jan 4, 2025
1 parent 733b5d7 commit 09c3790
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ jobs:
host: ${{ secrets.SSH_HOST }}
username: ubuntu
key: ${{ secrets.SSH_KEY }}
# password: ${{ secrets.SSH_PASSWORD }}
port: 22
source: "./docker-compose.a.yml"
target: "/home/ubuntu/"
Expand All @@ -80,31 +79,17 @@ jobs:
with:
host: ${{ secrets.SSH_HOST }}
username: ubuntu
password: ${{ secrets.SSH_PASSWORD }}
key: ${{ secrets.SSH_KEY }}
port: 22
source: "./docker-compose.b.yml"
target: "/home/ubuntu/"

# - name: executing remote ssh commands using password
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ubuntu
# password: ${{ secrets.SSH_PASSWORD }}
# port: 22
# script: |
# sudo docker rm -f $(sudo docker ps -q -f "expose=8080")
# sudo docker rm -f $(sudo docker ps -q -f "expose=6379")
# sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/jikgong
# sudo docker-compose up -d
# sudo docker image prune -f

- name: copy deploy.sh to remote server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ubuntu
password: ${{ secrets.SSH_PASSWORD }}
key: ${{ secrets.SSH_KEY }}
port: 22
source: "./deploy.sh"
target: "/home/ubuntu/"
Expand All @@ -114,7 +99,7 @@ jobs:
with:
host: ${{ secrets.SSH_HOST }}
username: ubuntu
password: ${{ secrets.SSH_PASSWORD }}
key: ${{ secrets.SSH_KEY }}
port: 22
script: |
chmod +x /home/ubuntu/deploy.sh
Expand Down

0 comments on commit 09c3790

Please sign in to comment.