Simplify Gitea workflow to use native docker cli instead of buildx
Build and Publish Docker Image / build-and-push-image (push) Failing after 7s
Build and Publish Docker Image / build-and-push-image (push) Failing after 7s
This commit is contained in:
@@ -1,55 +1,30 @@
|
|||||||
name: Build and Publish Docker Image
|
name: Build and Publish Docker Image
|
||||||
|
|
||||||
# Ce workflow se déclenche à chaque push sur la branche master
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# L'adresse de votre Gitea (Registre Docker)
|
REGISTRY: 192.168.10.174:3000
|
||||||
REGISTRY: http://192.168.10.174:3000
|
|
||||||
# homer/Skori (Généré automatiquement par la variable)
|
|
||||||
IMAGE_NAME: ${{ gitea.repository }}
|
IMAGE_NAME: ${{ gitea.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-image:
|
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
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
# Simple login directly with docker login (ensure your runner allows HTTP if not SSL)
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
# Autorise explicitement les connexions HTTP vers votre registre Gitea
|
|
||||||
buildkitd-flags: --allow-insecure-entitlement ${{ env.REGISTRY }}
|
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v3
|
run: echo "${{ secrets.GITEA_TOKEN }}" | docker login ${{ env.REGISTRY }} -u "${{ gitea.actor }}" --password-stdin
|
||||||
with:
|
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ gitea.actor }}
|
|
||||||
password: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
# Build standard using docker CLI
|
||||||
uses: docker/metadata-action@v5
|
- name: Build Docker image
|
||||||
id: meta
|
run: docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest .
|
||||||
with:
|
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
tags: |
|
|
||||||
type=raw,value=latest
|
|
||||||
type=sha
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
# Push directly using docker push
|
||||||
uses: docker/build-push-action@v5
|
- name: Push Docker image
|
||||||
with:
|
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||||
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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user