Files
bini-shorts-maker/.gitea/workflows/deploy.yaml
kihong.kim 40d7512e44
Some checks failed
Deploy to Server / deploy (push) Has been cancelled
Add Gitea Actions workflow for auto-deployment
Replace webhook-based deployment with Gitea Actions workflow.
On push to main, the workflow will:
- SSH into the server
- Pull latest code
- Rebuild and restart Docker containers

Required secrets in Gitea:
- SERVER_HOST
- SERVER_USER
- SERVER_SSH_KEY
- SERVER_PORT

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 19:06:52 +09:00

41 lines
1010 B
YAML

name: Deploy to Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy to server via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: |
cd /home/bini/shorts-maker
echo "=== Pulling latest code ==="
git fetch origin
git reset --hard origin/main
echo "=== Rebuilding Docker containers ==="
docker compose build --no-cache
echo "=== Restarting containers ==="
docker compose down
docker compose up -d
echo "=== Cleaning up old images ==="
docker image prune -f
echo "=== Deployment completed ==="
docker compose ps