Add CD
This commit is contained in:
@@ -49,3 +49,30 @@ jobs:
|
||||
context: .
|
||||
push: true
|
||||
tags: leor156/pogoda-api-tgbot:latest
|
||||
|
||||
|
||||
deploy:
|
||||
name: Deploy to VPS via SSH
|
||||
needs: build-and-push
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Подключение по SSH и обновление контейнера
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
username: ${{ secrets.SSH_USERNAME }}
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
script: |
|
||||
docker pull leor156/pogoda-api-tgbot:latest
|
||||
|
||||
docker stop weather_bot || true
|
||||
docker rm weather_bot || true
|
||||
|
||||
docker run -d \
|
||||
--name weather_bot \
|
||||
--restart unless-stopped \
|
||||
-e TG_TOKEN="${{ secrets.TG_TOKEN }}" \
|
||||
-e WEATHER_API_KEY="${{ secrets.WEATHER_API_KEY }}" \
|
||||
leor156/pogoda-api-tgbot:latest
|
||||
|
||||
docker image prune -f
|
||||
|
||||
Reference in New Issue
Block a user