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