fix: korrigiere CI-Pipeline-Namen und füge Tag-Handling für Docker-Images hinzu
This commit is contained in:
@@ -3,11 +3,13 @@
|
||||
#
|
||||
|
||||
name: Build And Test
|
||||
run-name: ${{ gitea.actor }} is runs ci pipeline
|
||||
run-name: ${{ gitea.actor }} started ci pipeline
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*' # Tags, die mit "v" anfangen, z. B. v1.0.0
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
build:
|
||||
@@ -24,6 +26,7 @@ jobs:
|
||||
|
||||
publish:
|
||||
needs: build
|
||||
name: Build and Publish Docker Image
|
||||
runs-on: ubuntu-latest
|
||||
if: gitea.ref == 'refs/heads/main'
|
||||
steps:
|
||||
@@ -48,10 +51,19 @@ jobs:
|
||||
[registry."git.hnrx.net"]
|
||||
username = "${{ secrets.DOCKER_USERNAME }}"
|
||||
password = "${{ secrets.DOCKER_PASSWORD }}"
|
||||
- name: Build and Push Docker Image
|
||||
- name: Build and Push Docker latest Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: git.hnrx.net/homelab/manage-servers:latest
|
||||
tags: git.hnrx.net/hnrx/manage-servers:latest
|
||||
file: ./Dockerfile
|
||||
|
||||
- name: Build and Push Docker versioned Image ${{ gitea.ref_name }}
|
||||
if: startsWith(gitea.ref, 'refs/tags/v') && (gitea.ref_name =~ '^v[0-9]+\.[0-9]+\.[0-9]+$')
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: git.hnrx.net/hnrx/manage-servers:${{ gitea.ref_name }}
|
||||
file: ./Dockerfile
|
||||
Reference in New Issue
Block a user