Restore production workflow for Docker builds
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 5s
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:
parent
43c969bf55
commit
485d4540e3
1 changed files with 22 additions and 52 deletions
|
|
@ -10,60 +10,30 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Quick Network Test (no installs)
|
||||
- name: Checkout repository
|
||||
run: |
|
||||
echo "=== DNS Configuration ==="
|
||||
cat /etc/resolv.conf || echo "Cannot read resolv.conf"
|
||||
git clone ${{ github.server_url }}/${{ github.repository }} .
|
||||
git checkout ${{ github.sha }}
|
||||
ls -la
|
||||
|
||||
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
|
||||
- name: Build Docker image
|
||||
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
|
||||
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
|
||||
- name: Log in to Forgejo Container Registry
|
||||
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
|
||||
echo "${{ secrets.GITEA_TOKEN }}" | docker login forgejo.sivic.me -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Push Docker images
|
||||
run: |
|
||||
docker push forgejo.sivic.me/${{ github.repository }}:latest
|
||||
docker push forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
echo "✅ Successfully built and pushed:"
|
||||
echo " - forgejo.sivic.me/${{ github.repository }}:latest"
|
||||
echo " - forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue