Skip to content

Commit

Permalink
update :: develop workflows를 ssh actions으로
Browse files Browse the repository at this point in the history
  • Loading branch information
esperar committed Sep 24, 2024
1 parent 61e4921 commit 2bc4ed3
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/dotori-develop-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ jobs:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}

- name: Docker stop container
run: sudo docker rm -f dotori-dev 2>/dev/null || true

- name: Docker remove Image
run: sudo docker rmi ${{secrets.DOCKERHUB_USERNAME}}/dotori-dev

- name: Pull Docker image
run: sudo docker pull ${{secrets.DOCKERHUB_USERNAME}}/dotori-dev

- name: Run Docker Container
run: sudo docker run --net="host" --name dotori-dev --rm -d -p 8080:8080 ${{secrets.DOCKERHUB_USERNAME}}/dotori-dev
- name: Deploy to dev
uses: appleboy/ssh-action@master
id: dotori-dev
with:
host: ${{ secrets.HOST_DEV }} # EC2 퍼블릭 IPv4 DNS
username: ubuntu
password: ${{ secrets.PASSWORD }}
port: 22
key: ${{ secrets.AWS_SECRET_KEY }}
script: |
sudo docker ps
sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/dotori-dev
sudo docker run -d -p 8081:8081 ${{ secrets.DOCKERHUB_USERNAME }}/dotori-dev
sudo docker image prune -f

0 comments on commit 2bc4ed3

Please sign in to comment.