fix: Configurazione workflow per registry Gitea interno
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 21s
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 21s
- Modificato target da Docker Hub a gitea.home-nas-ds.org - Aggiunto parametro registry al login - Semplificata logica push (sempre attivo tranne per PR) - Image name: gitea.home-nas-ds.org/alessio/ha-voltronic-mqtt
This commit is contained in:
@@ -32,20 +32,16 @@ jobs:
|
||||
- name: Prepare image name
|
||||
id: image-name
|
||||
run: |
|
||||
if [ -n "${{ secrets.DOCKER_USERNAME }}" ]; then
|
||||
echo "IMAGE_NAME=${{ secrets.DOCKER_USERNAME }}/ha-voltronic-mqtt" >> $GITHUB_OUTPUT
|
||||
echo "SHOULD_PUSH=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "IMAGE_NAME=local/ha-voltronic-mqtt" >> $GITHUB_OUTPUT
|
||||
echo "SHOULD_PUSH=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
# Usa il registry Gitea
|
||||
echo "IMAGE_NAME=gitea.home-nas-ds.org/alessio/ha-voltronic-mqtt" >> $GITHUB_OUTPUT
|
||||
echo "SHOULD_PUSH=true" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
${{ steps.image-name.outputs.IMAGE_NAME }}
|
||||
gitea.home-nas-ds.org/alessio/ha-voltronic-mqtt
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
@@ -53,10 +49,11 @@ jobs:
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request' && steps.image-name.outputs.SHOULD_PUSH == 'true'
|
||||
- name: Login to Gitea Container Registry
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: gitea.home-nas-ds.org
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -66,7 +63,7 @@ jobs:
|
||||
context: .
|
||||
file: ./Dockerfile.multiarch
|
||||
platforms: linux/arm/v6,linux/arm/v7,linux/arm64
|
||||
push: ${{ steps.image-name.outputs.SHOULD_PUSH == 'true' && github.event_name != 'pull_request' }}
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
|
||||
Reference in New Issue
Block a user