From 106dac9ca483cea86c23cf81480a42d4499efe44 Mon Sep 17 00:00:00 2001 From: Sepehr Ramezani Date: Tue, 21 Apr 2026 22:34:18 +0200 Subject: [PATCH] ci: add Gitea Actions workflow for auto-deploy on push to main 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 --- .gitea/workflows/deploy.yaml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..e1a56cb --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -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 ==="