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
|
#!/bin/bash
|
||||||
# Deploy hatch.surf
|
# Deploy hatch.surf - triggered by Gitea webhook or manually
|
||||||
# Run this script to build and deploy the Docker container
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "=== Deploying hatch.surf ==="
|
echo "=== Deploying hatch.surf ==="
|
||||||
|
cd /home/nara/apps/web
|
||||||
|
|
||||||
# Build the Docker image
|
# Pull latest changes
|
||||||
echo "Building Docker image..."
|
git pull origin main
|
||||||
|
|
||||||
|
# Build and deploy
|
||||||
docker build -t hatch-web:latest .
|
docker build -t hatch-web:latest .
|
||||||
|
|
||||||
# Stop existing container
|
|
||||||
echo "Stopping existing container..."
|
|
||||||
docker stop hatch-web 2>/dev/null || true
|
docker stop hatch-web 2>/dev/null || true
|
||||||
docker rm 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
|
docker compose up -d
|
||||||
|
|
||||||
# Wait for health check
|
|
||||||
echo "Waiting for container to be healthy..."
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
# Verify
|
# Verify
|
||||||
|
sleep 5
|
||||||
if curl -s -o /dev/null -w "%{http_code}" http://localhost:8080 | grep -q "200"; then
|
if curl -s -o /dev/null -w "%{http_code}" http://localhost:8080 | grep -q "200"; then
|
||||||
echo "✅ hatch.surf deployed successfully!"
|
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
|
else
|
||||||
echo "❌ Deployment failed!"
|
echo "❌ Deployment failed!"
|
||||||
docker logs hatch-web
|
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