Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 18s
- Use only built-in commands (cat, wget, bash) - Test basic connectivity with /dev/tcp - 5 second timeouts to prevent hanging - Check if runner has ANY internet access - Diagnose runner network configuration issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
69 lines
2.5 KiB
YAML
69 lines
2.5 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Quick Network Test (no installs)
|
|
run: |
|
|
echo "=== DNS Configuration ==="
|
|
cat /etc/resolv.conf || echo "Cannot read resolv.conf"
|
|
|
|
echo ""
|
|
echo "=== Hosts file ==="
|
|
cat /etc/hosts || echo "Cannot read hosts"
|
|
|
|
echo ""
|
|
echo "=== Can we reach the internet? ==="
|
|
timeout 5 wget -O- http://google.com 2>&1 | head -5 || echo "Cannot reach google.com"
|
|
|
|
echo ""
|
|
echo "=== Can we reach Forgejo? ==="
|
|
timeout 5 wget -O- https://forgejo.sivic.me 2>&1 | head -5 || echo "Cannot reach forgejo.sivic.me"
|
|
|
|
echo ""
|
|
echo "=== Environment ==="
|
|
echo "Repository: ${{ github.repository }}"
|
|
echo "Server URL: ${{ github.server_url }}"
|
|
|
|
echo ""
|
|
echo "=== Network interfaces ==="
|
|
cat /proc/net/dev || echo "Cannot read network devices"
|
|
|
|
echo ""
|
|
echo "=== Default route ==="
|
|
cat /proc/net/route || echo "Cannot read routing table"
|
|
|
|
- name: Test if we're online at all
|
|
run: |
|
|
echo "Testing basic connectivity..."
|
|
|
|
# Try to connect to Google's DNS
|
|
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/8.8.8.8/53' 2>&1 && echo "Can reach 8.8.8.8:53" || echo "CANNOT reach 8.8.8.8:53"
|
|
|
|
# Try to connect to Google HTTP
|
|
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/google.com/80' 2>&1 && echo "Can reach google.com:80" || echo "CANNOT reach google.com:80"
|
|
|
|
# Try to connect to Forgejo
|
|
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/forgejo.sivic.me/443' 2>&1 && echo "Can reach forgejo.sivic.me:443" || echo "CANNOT reach forgejo.sivic.me:443"
|
|
|
|
- name: Stop here and report
|
|
run: |
|
|
echo ""
|
|
echo "================================================================"
|
|
echo "DIAGNOSIS:"
|
|
echo "If you cannot reach 8.8.8.8:53, your runner has NO internet access"
|
|
echo "This is a runner configuration issue, not a DNS issue"
|
|
echo ""
|
|
echo "Fix: Check your Forgejo runner network configuration"
|
|
echo "- Is the runner container using host networking?"
|
|
echo "- Does the host have internet access?"
|
|
echo "- Are there firewall rules blocking the runner?"
|
|
echo "================================================================"
|
|
exit 1
|