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 ==="