Skip to content

Commit

Permalink
feat: deploy.yaml에 ssh-action 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
yeolyi committed Feb 10, 2024
1 parent 1b6fc5e commit e99ce45
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,13 @@ jobs:
tags: |
ghcr.io/wafflestudio/csereal_nextjs_image:latest
ghcr.io/wafflestudio/csereal_nextjs_image:${{github.sha}}
- name: 'Prepare deploy key'
run: |
echo "${{secrets.SSH_KEY}}" > deploy_key
chmod 600 ./deploy_key
- name: 'Remote server commands'
uses: 'nick-fields/retry@v2'
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@v1.0.3
with:
timeout_minutes: 1
max_attempts: 5
retry_wait_seconds: 1
retry_on: 'error'
command: |
ssh -T -i ./deploy_key -p 22 ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
script: |
docker stop csereal_nextjs_image
docker rm csereal_nextjs_image
docker pull ghcr.io/wafflestudio/csereal_nextjs_image:latest
Expand Down

0 comments on commit e99ce45

Please sign in to comment.