From 7dd333b19ddbfc9282e3e6a49fc1b22385c350af Mon Sep 17 00:00:00 2001 From: Ken Date: Tue, 26 May 2026 22:21:33 +0000 Subject: [PATCH] ci: add Gitea Actions deploy workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Triggers on push to main. Builds frontend, stops old container, builds and starts new Docker container, verifies the new UI is live. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com> --- .gitea/workflows/deploy.yml | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..903c003 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,60 @@ +name: Deploy Research Workbench + +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Pull latest code + working-directory: /home/ken/workspace/research-workbench + run: | + git pull origin main + + - name: Build frontend + working-directory: /home/ken/workspace/research-workbench/frontend + run: | + npm ci + npm run build + + - name: Stop old containers + working-directory: /home/ken/workspace/research-workbench + run: | + # Stop the old car-help container if still running + docker rm -f car-help 2>/dev/null || true + # Stop any existing workbench container + docker compose down 2>/dev/null || true + + - name: Build and start container + working-directory: /home/ken/workspace/research-workbench + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + AUTH_USER: ${{ secrets.AUTH_USER }} + AUTH_PASS_HASH: ${{ secrets.AUTH_PASS_HASH }} + run: | + docker compose up --build -d + + - name: Wait for healthy + run: | + echo "Waiting for container to start..." + for i in $(seq 1 60); do + if curl -sf http://localhost:8080/ > /dev/null 2>&1; then + echo "App is up at http://localhost:8080/" + exit 0 + fi + sleep 2 + done + echo "ERROR: App did not respond within 120s" + docker compose -f /home/ken/workspace/research-workbench/docker-compose.yml logs --tail=50 + exit 1 + + - name: Verify new UI is served + run: | + BODY=$(curl -sf http://localhost:8080/ || echo "FETCH_FAILED") + if echo "$BODY" | grep -qi "car-help"; then + echo "ERROR: Still serving old car-help UI!" + exit 1 + fi + echo "Deploy successful - new UI is live at https://research.ampbox.io"