fix: docker image build repo name
This commit is contained in:
parent
a7e94e9673
commit
6be739857c
1 changed files with 14 additions and 3 deletions
17
.github/workflows/docker-build.yml
vendored
17
.github/workflows/docker-build.yml
vendored
|
@ -36,23 +36,34 @@ jobs:
|
|||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Get the Ref
|
||||
id: get-ref
|
||||
uses: https://github.com/ankitvgupta/ref-to-tag-action@master
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
head_ref: ${{ github.head_ref }}
|
||||
|
||||
- name: lowercase repo name
|
||||
run: |
|
||||
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
|
||||
|
||||
- name: Build and push (pull_request)
|
||||
uses: docker/build-push-action@v6
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ github.repository }}:sha_${{ github.sha }},${{ github.repository }}:pr_${{ github.head_ref }}
|
||||
tags: git.dominikstahl.dev/${{ env.REPO }}:sha_${{ github.sha }},git.dominikstahl.dev/${{ env.REPO }}:${{ steps.get-ref.outputs.tag}}
|
||||
|
||||
- name: Build and push (push_tag)
|
||||
uses: docker/build-push-action@v6
|
||||
if: github.event_name == 'push' && github.ref_type == 'tag'
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ github.repository }}:${{ github.ref_name }},${{ github.repository }}:latest
|
||||
tags: git.dominikstahl.dev/${{ env.REPO }}:${{ steps.get-ref.outputs.tag }},git.dominikstahl.dev/${{ env.REPO }}:latest
|
||||
|
||||
- name: Build and push (push_branch)
|
||||
uses: docker/build-push-action@v6
|
||||
if: github.event_name == 'push' && github.ref_type == 'branch'
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ github.repository }}:sha_${{ github.sha }},${{ github.repository }}:main
|
||||
tags: git.dominikstahl.dev/${{ env.REPO }}:sha_${{ github.sha }},git.dominikstahl.dev/${{ env.REPO }}:main
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue