Skip to content

Commit

Permalink
feat: updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vomaksh committed Jun 16, 2024
1 parent 25f13a9 commit ce4589b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,20 @@ jobs:
file: src/listener/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/listener:latest

- name: Setup ssh key
run: |
mkdir -p ~/.ssh/
echo "${{ secrets.ACTION_PRIVATE_KEY }}" > ~/.ssh/github_action.key
sudo chmod 600 ~/.ssh/github_action.key
ssh-keyscan -H ${{ secrets.SERVER_IP }} > ~/.ssh/known_hosts
- name: Deploy
run: |
ssh {{ secrets.SERVER_USERNAME }}@{{ secrets.SERVER_IP }} /bin/bash << EOF
cd {{ secrets.REPO_PATH }};
git pull origin master;
docker compose down;
docker compose pull;
docker compose up -d;
EOF
6 changes: 0 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
services:
listener:
image: ghcr.io/ginruh/hckernews/listener:latest

watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 30

0 comments on commit ce4589b

Please sign in to comment.