wesal/.github/workflows/deploy-prod.yml
2025-07-27 09:44:13 +03:00

34 lines
788 B
YAML

name: Deploy to Production
on:
push:
branches:
- main
- master
jobs:
deploy:
name: Deploy to Production
needs: build_and_push
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
environment: production
steps:
- name: Deploy to Server
uses: appleboy/ssh-action@v0.1.5
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: |
whoami
cd /home/wesal
git pull origin main
docker compose down
docker compose up -d --build
docker image prune -f