ci: add Gitea Actions workflow for auto-deploy on push to main
Some checks failed
Deploy to Production / Deploy to 192.168.1.190 (push) Has been cancelled
Some checks failed
Deploy to Production / Deploy to 192.168.1.190 (push) Has been cancelled
SSH-based deployment to 192.168.1.190 via Gitea Runner. Builds Docker images and restarts containers automatically. Required Gitea secrets: DEPLOY_HOST, DEPLOY_USER, DEPLOY_SSH_KEY, DEPLOY_PATH Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
43
.gitea/workflows/deploy.yaml
Normal file
43
.gitea/workflows/deploy.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Deploy to Production
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to 192.168.1.190
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy via SSH
|
||||
uses: appleboy/ssh-action@v1.2.2
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_HOST }}
|
||||
username: ${{ secrets.DEPLOY_USER }}
|
||||
key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
port: ${{ secrets.DEPLOY_PORT || 22 }}
|
||||
script: |
|
||||
set -e
|
||||
|
||||
echo "=== Memento Deploy ==="
|
||||
echo "Branch: ${{ gitea.ref }}"
|
||||
|
||||
# Go to project directory
|
||||
cd ${{ secrets.DEPLOY_PATH }}/Momento
|
||||
|
||||
# Pull latest code
|
||||
git pull origin main
|
||||
|
||||
# Build and restart containers
|
||||
docker compose build --parallel
|
||||
docker compose up -d
|
||||
|
||||
# Wait for healthchecks
|
||||
echo "Waiting for containers to be healthy..."
|
||||
sleep 10
|
||||
|
||||
# Check status
|
||||
docker compose ps
|
||||
|
||||
echo "=== Deploy complete ==="
|
||||
Reference in New Issue
Block a user