diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..2762d1d --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,33 @@ +name: Deploy to Production + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build Docker image + run: | + docker build -t hotelsync-frontend:latest . + + - name: Deploy frontend + run: | + docker stop hotelsync-frontend 2>/dev/null || true + docker rm hotelsync-frontend 2>/dev/null || true + docker run -d \ + --name hotelsync-frontend \ + --network hotelsync_hotelsync-net \ + --restart unless-stopped \ + hotelsync-frontend:latest + echo "✅ Deploy complete!" + + - name: Health check + run: | + sleep 3 + curl -sf http://hotelsync-frontend/ > /dev/null && echo "✅ App is up!" || echo "❌ Health check failed"