Disable Gitea Actions, use manual deploy script
- Gitea Actions runner has Docker networking issues - Created deploy.sh for manual deployment - Created webhook.sh for future webhook-based deployment - Deployment is now: git pull && ./deploy.sh Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
d2ec362d74
commit
87614376f9
@ -1,19 +0,0 @@
|
||||
name: Deploy hatch.surf
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build and Deploy
|
||||
run: |
|
||||
chmod +x deploy.sh
|
||||
./deploy.sh
|
||||
24
deploy.sh
24
deploy.sh
@ -1,34 +1,24 @@
|
||||
#!/bin/bash
|
||||
# Deploy hatch.surf
|
||||
# Run this script to build and deploy the Docker container
|
||||
# Deploy hatch.surf - triggered by Gitea webhook or manually
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== Deploying hatch.surf ==="
|
||||
cd /home/nara/apps/web
|
||||
|
||||
# Build the Docker image
|
||||
echo "Building Docker image..."
|
||||
# Pull latest changes
|
||||
git pull origin main
|
||||
|
||||
# Build and deploy
|
||||
docker build -t hatch-web:latest .
|
||||
|
||||
# Stop existing container
|
||||
echo "Stopping existing container..."
|
||||
docker stop hatch-web 2>/dev/null || true
|
||||
docker rm hatch-web 2>/dev/null || true
|
||||
|
||||
# Start new container
|
||||
echo "Starting new container..."
|
||||
docker compose up -d
|
||||
|
||||
# Wait for health check
|
||||
echo "Waiting for container to be healthy..."
|
||||
sleep 5
|
||||
|
||||
# Verify
|
||||
sleep 5
|
||||
if curl -s -o /dev/null -w "%{http_code}" http://localhost:8080 | grep -q "200"; then
|
||||
echo "✅ hatch.surf deployed successfully!"
|
||||
echo " Container: hatch-web"
|
||||
echo " Port: 8080"
|
||||
echo " Status: $(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080)"
|
||||
else
|
||||
echo "❌ Deployment failed!"
|
||||
docker logs hatch-web
|
||||
|
||||
19
webhook.sh
Executable file
19
webhook.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# Webhook endpoint for Gitea - triggers deployment
|
||||
# Add this to Gitea repository webhooks: http://localhost:9000/deploy
|
||||
|
||||
PORT=9000
|
||||
SCRIPT_DIR="/home/nara/apps/web"
|
||||
|
||||
echo "Starting webhook server on port $PORT..."
|
||||
|
||||
while true; do
|
||||
# Wait for HTTP request
|
||||
REQUEST=$(nc -l -p $PORT -q 1 2>/dev/null)
|
||||
|
||||
if echo "$REQUEST" | grep -q "POST /deploy"; then
|
||||
echo "Webhook received - deploying..."
|
||||
$SCRIPT_DIR/deploy.sh >> /tmp/hatch-deploy.log 2>&1
|
||||
echo "Deploy complete"
|
||||
fi
|
||||
done
|
||||
Loading…
Reference in New Issue
Block a user