From 4e7b23d8919ab016c2548d2386bd6a0d6379e30c Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 30 Aug 2024 17:47:35 +0200 Subject: [PATCH] dd --- .gitea/workflows/build.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 6770d79..0d2ae37 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -17,18 +17,21 @@ jobs: # with: # username: ${{ secrets.DOCKERHUB_USERNAME }} # password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Get Meta + - name: Extract repository name id: meta run: | echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT - REPO_BRANCH=$(git rev-parse --abbrev-ref HEAD) + - name: Extract branch name + shell: bash + run: echo "REPO_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch - name: Build and push Docker image uses: https://github.com/docker/build-push-action@v5 with: context: . file: ./Dockerfile push: true - tags: "registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:latest,registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_BRANCH }}" + tags: "registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:latest,registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.extract_branch.outputs.REPO_BRANCH }}" # depends on lint