faisalnazeer67's picture
chore: add github action
503366f
Raw
History Blame Contribute Delete
643 Bytes
name: Deploy to Droplet
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy via SSH
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.DROPLET_IP }}
username: root
key: ${{ secrets.DROPLET_SSH_KEY }}
script: |
cd /opt/blog2video
git fetch origin main
git checkout main
git pull origin main
docker compose down
docker compose build --no-cache
docker compose up -d
docker image prune -f
echo "Deploy complete at $(date)"