Skip to content

Commit

Permalink
ci: deploy with watchtower
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryDorofeev committed Nov 20, 2024
1 parent d16265c commit 630d7cd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@ jobs:
docker push dmitrydorofeev/godeploy:${GITHUB_SHA::8}
docker push dmitrydorofeev/godeploy:latest
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: pull docker image
uses: appleboy/ssh-action@master
with:
envs: GITHUB_SHA
host: 217.16.27.70
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
script: sudo docker pull dmitrydorofeev/godeploy:${GITHUB_SHA::8}
- name: deploy docker image
uses: appleboy/ssh-action@master
with:
envs: GITHUB_SHA
host: 217.16.27.70
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
script: |
sudo docker rm -f $(sudo docker ps -aq)
sudo docker run -e VERSION=${GITHUB_SHA::8} -d -p 8080:8080 dmitrydorofeev/godeploy:${GITHUB_SHA::8}
# deploy:
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: pull docker image
# uses: appleboy/ssh-action@master
# with:
# envs: GITHUB_SHA
# host: 217.16.27.70
# username: ubuntu
# key: ${{ secrets.PRIVATE_KEY }}
# script: sudo docker pull dmitrydorofeev/godeploy:${GITHUB_SHA::8}
# - name: deploy docker image
# uses: appleboy/ssh-action@master
# with:
# envs: GITHUB_SHA
# host: 217.16.27.70
# username: ubuntu
# key: ${{ secrets.PRIVATE_KEY }}
# script: |
# sudo docker rm -f $(sudo docker ps -aq)
# sudo docker run -e VERSION=${GITHUB_SHA::8} -d -p 8080:8080 dmitrydorofeev/godeploy:${GITHUB_SHA::8}
2 changes: 1 addition & 1 deletion cmd/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func run() error {
})

e.GET("/", func(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World! I'm deployed again!")
return c.String(http.StatusOK, "Hello, World! I'm deployed again with watchtower!")
})

ctx := context.Background()
Expand Down

0 comments on commit 630d7cd

Please sign in to comment.