Files
docker-voltronic-homeassistant/.gitea/workflows/docker-build.yml
T
Alessio Dal Santo 403f5f3ef0
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 6m43s
Fix: Configurazione registry HTTP locale per evitare Cloudflare
- Aggiunto env REGISTRY: 192.168.1.37:30008 per bypassare Cloudflare
- Configurato buildx per supportare HTTP insecure sul registry locale
- Aggiornato docker meta per usare registry IP diretto
- Modificato login per autenticarsi su 192.168.1.37:30008
- Risolto errore 413 Payload Too Large causato da Cloudflare
2026-01-27 17:30:15 +01:00

96 lines
2.5 KiB
YAML

name: Build Docker Image for Raspberry Pi
on:
push:
branches:
- main
- master
- develop
tags:
- 'v*'
pull_request:
branches:
- main
- master
env:
REGISTRY: 192.168.1.37:30008
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/arm/v7,linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
image=moby/buildkit:latest
network=host
config-inline: |
[registry."192.168.1.37:30008"]
http = true
insecure = true
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Login to Gitea Container Registry
if: github.event_name != 'pull_request'
run: |
echo "Configurazione autenticazione registry..."
mkdir -p ~/.docker
AUTH=$(echo -n "${{ github.actor }}:${{ secrets.REGISTRY_TOKEN }}" | base64)
cat > ~/.docker/config.json << EOF
{
"auths": {
"192.168.1.37:30008": {
"auth": "$AUTH"
}
}
}
EOF
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.multiarch
platforms: linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_DATE=${{ github.event.repository.updated_at }}
VERSION=${{ steps.meta.outputs.version }}
VCS_REF=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
outputs: type=registry,registry.insecure=true
- name: Image digest
run: echo ${{ steps.meta.outputs.tags }}