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
|
name: Build And Test
|
||||||
run-name: ${{ gitea.actor }} is runs ci pipeline
|
run-name: ${{ gitea.actor }} started ci pipeline
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
tags:
|
||||||
|
- 'v*' # Tags, die mit "v" anfangen, z. B. v1.0.0
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -24,6 +26,7 @@ jobs:
|
|||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: build
|
needs: build
|
||||||
|
name: Build and Publish Docker Image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: gitea.ref == 'refs/heads/main'
|
if: gitea.ref == 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
@@ -48,10 +51,19 @@ jobs:
|
|||||||
[registry."git.hnrx.net"]
|
[registry."git.hnrx.net"]
|
||||||
username = "${{ secrets.DOCKER_USERNAME }}"
|
username = "${{ secrets.DOCKER_USERNAME }}"
|
||||||
password = "${{ secrets.DOCKER_PASSWORD }}"
|
password = "${{ secrets.DOCKER_PASSWORD }}"
|
||||||
- name: Build and Push Docker Image
|
- name: Build and Push Docker latest Image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
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
|
file: ./Dockerfile
|
||||||
Reference in New Issue
Block a user