Simplify Gitea workflow to use native docker cli instead of buildx
Build and Publish Docker Image / build-and-push-image (push) Failing after 7s

This commit is contained in:
Zed
2026-07-06 19:13:49 +02:00
parent 3a8ee28bdd
commit 253f83b08b
+9 -34
View File
@@ -1,55 +1,30 @@
name: Build and Publish Docker Image
# Ce workflow se déclenche à chaque push sur la branche master
on:
push:
branches:
- master
env:
# L'adresse de votre Gitea (Registre Docker)
REGISTRY: http://192.168.10.174:3000
# homer/Skori (Généré automatiquement par la variable)
REGISTRY: 192.168.10.174:3000
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build-and-push-image:
# Assurez-vous que votre Gitea Runner possède le label 'ubuntu-latest' (c'est le défaut)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# Autorise explicitement les connexions HTTP vers votre registre Gitea
buildkitd-flags: --allow-insecure-entitlement ${{ env.REGISTRY }}
# Simple login directly with docker login (ensure your runner allows HTTP if not SSL)
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
run: echo "${{ secrets.GITEA_TOKEN }}" | docker login ${{ env.REGISTRY }} -u "${{ gitea.actor }}" --password-stdin
- name: Extract metadata (tags, labels) for Docker
uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha
# Build standard using docker CLI
- name: Build Docker image
run: docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest .
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push=true,registry.insecure=true
# Push directly using docker push
- name: Push Docker image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest