|
29 | 29 | oauth-secret: ${{ secrets.TAILSCALE_OAUTH_SECRET }} |
30 | 30 | tags: tag:ci |
31 | 31 |
|
| 32 | + - name: Configure Tailscale DNS and test connection |
| 33 | + run: | |
| 34 | + # Wait for Tailscale to fully initialize |
| 35 | + sleep 5 |
| 36 | +
|
| 37 | + # Display Tailscale status for debugging |
| 38 | + echo "Tailscale status:" |
| 39 | + tailscale status |
| 40 | +
|
| 41 | + # Use nslookup to debug DNS issues |
| 42 | + echo "Checking DNS resolution through Tailscale..." |
| 43 | + # Get Tailscale DNS server if available |
| 44 | + TAILSCALE_DNS=$(tailscale status --json | jq -r '.Self.DNSServers[]' 2>/dev/null | head -1) |
| 45 | +
|
| 46 | + if [ -n "$TAILSCALE_DNS" ]; then |
| 47 | + echo "Using Tailscale DNS server: $TAILSCALE_DNS" |
| 48 | + nslookup relisten2.tail09dbf.ts.net $TAILSCALE_DNS || echo "DNS lookup failed but continuing" |
| 49 | + else |
| 50 | + echo "No Tailscale DNS server found" |
| 51 | + fi |
| 52 | +
|
| 53 | + # Get direct IP address from tailscale |
| 54 | + echo "Looking up host in Tailscale network..." |
| 55 | + tailscale ip -4 relisten2 || echo "Tailscale ip lookup failed" |
| 56 | +
|
| 57 | + # Manual IP address as fallback |
| 58 | + echo "Setting registry address as environment variable" |
| 59 | + # Set a manual IP address if you know it (replace with your actual IP) |
| 60 | + echo "REGISTRY_ADDRESS=100.x.y.z" >> $GITHUB_ENV |
| 61 | +
|
32 | 62 | - name: Build Docker image |
33 | 63 | uses: docker/build-push-action@v4 |
34 | 64 | with: |
|
37 | 67 | load: true |
38 | 68 | tags: relisten2.tail09dbf.ts.net:32000/relistennet/relisten-web:latest |
39 | 69 |
|
40 | | - - name: Push to registry over Tailscale network |
| 70 | + - name: Push to registry using IP address |
41 | 71 | run: | |
42 | | - docker push relisten2.tail09dbf.ts.net:32000/relistennet/relisten-web:latest |
| 72 | + # Use the environment variable set earlier (replace with actual IP if you know it) |
| 73 | + # If you don't know the IP yet, set it to a placeholder and update after testing |
| 74 | + REGISTRY_IP="${{ env.REGISTRY_ADDRESS }}" |
| 75 | + echo "Using registry IP: $REGISTRY_IP" |
| 76 | +
|
| 77 | + # Tag image with the IP address |
| 78 | + docker tag relistennet/relisten-web:latest $REGISTRY_IP:32000/relistennet/relisten-web:latest |
| 79 | +
|
| 80 | + # Configure Docker to use this insecure registry |
| 81 | + echo '{ |
| 82 | + "insecure-registries": ["'$REGISTRY_IP:32000'"] |
| 83 | + }' | sudo tee /etc/docker/daemon.json |
| 84 | + sudo systemctl restart docker |
| 85 | + sleep 5 |
| 86 | +
|
| 87 | + # Push with IP address |
| 88 | + docker push $REGISTRY_IP:32000/relistennet/relisten-web:latest |
43 | 89 |
|
44 | 90 | - name: Install kubectl |
45 | 91 | uses: azure/setup-kubectl@v3 |
|
0 commit comments