Files
webApp/.gitea/workflows/docker-build.yml
lionel dece80a717
All checks were successful
Build & Push Docker Image with Commit Hash Tag / build-and-push (push) Successful in 2m25s
Add CI workflow
2025-07-07 22:45:08 +02:00

40 lines
1.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build & Push Docker Image with Commit Hash Tag
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build-and-push:
runs-on: docker
steps:
- name: 📦 Cloner le dépôt
uses: actions/checkout@v3
- name: ⚙️ Récupérer le hash court du commit
id: vars
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITEA_OUTPUT
- name: 🔐 Connexion au registre Docker (Gitea)
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: ⚙️ Préparer Buildx
uses: docker/setup-buildx-action@v3
- name: 🐳 Construire & pousser limage avec Buildx
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_REPOSITORY }}:latest
${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_REPOSITORY }}:${{ steps.vars.outputs.COMMIT_HASH }}
platforms: linux/amd64