name: Build and Publish Docker Image on: push: branches: [ "main" ] tags: [ 'v*' ] # Déclencheur sur les tags ajouté ici aussi env: REGISTRY: ghcr.io IMAGE_NAME: reivax69008/aethas-multi-ia jobs: build-and-push: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - name: Checkout du code uses: actions/checkout@v4 # NOUVEAU : Identique à Gitea, gère ghcr.io - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=raw,value=latest,enable={{is_default_branch}} type=semver,pattern={{version}} - name: Connexion au registre GitHub (ghcr.io) uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Construction et publication de l'image uses: docker/build-push-action@v5 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}