Restore production workflow for Docker builds
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 5s

- Clone repository and checkout specific SHA
- Build Docker image with latest and SHA tags
- Push to Forgejo container registry
- Clean and simple workflow now that DNS is fixed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Kevin Sivic 2025-11-30 23:55:39 -05:00
parent 43c969bf55
commit 485d4540e3

View file

@ -10,60 +10,30 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Quick Network Test (no installs) - name: Checkout repository
run: | run: |
echo "=== DNS Configuration ===" git clone ${{ github.server_url }}/${{ github.repository }} .
cat /etc/resolv.conf || echo "Cannot read resolv.conf" git checkout ${{ github.sha }}
ls -la
echo "" - name: Build Docker image
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: | run: |
echo "Testing basic connectivity..." docker build \
-t forgejo.sivic.me/${{ github.repository }}:latest \
-t forgejo.sivic.me/${{ github.repository }}:${{ github.sha }} \
.
# Try to connect to Google's DNS - name: Log in to Forgejo Container Registry
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: | run: |
echo "" echo "${{ secrets.GITEA_TOKEN }}" | docker login forgejo.sivic.me -u ${{ github.actor }} --password-stdin
echo "================================================================"
echo "DIAGNOSIS:" - name: Push Docker images
echo "If you cannot reach 8.8.8.8:53, your runner has NO internet access" run: |
echo "This is a runner configuration issue, not a DNS issue" docker push forgejo.sivic.me/${{ github.repository }}:latest
echo "" docker push forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}
echo "Fix: Check your Forgejo runner network configuration"
echo "- Is the runner container using host networking?" - name: Summary
echo "- Does the host have internet access?" run: |
echo "- Are there firewall rules blocking the runner?" echo "✅ Successfully built and pushed:"
echo "================================================================" echo " - forgejo.sivic.me/${{ github.repository }}:latest"
exit 1 echo " - forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}"