Skip to content

Commit 6e9044e

Browse files
committed
fix workflow part IV
1 parent a89a462 commit 6e9044e

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/build-release-latest.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,27 @@ on:
55
branches: '*'
66

77
env:
8-
cr_image: ghcr.io/${{ github.repository }}/build
8+
# ERROR: failed to build: invalid tag "ghcr.io/HenriWahl/checkmk-agent-plugin-yum/build:build-image": repository name must be lowercase
9+
# this is the penalty for using uppercase letters in repository names...
10+
cr_image: ghcr.io/henriwahl/checkmk-agent-plugin-yum/build:${{ github.run_id }}
911

1012
jobs:
1113
build-image:
1214
runs-on: ubuntu-latest
1315
steps:
1416
- uses: actions/checkout@v4
17+
# docker login is needed for pushing the test image
18+
- uses: docker/login-action@v3
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
# somehow weird way to get the hash over the requirements to be aware if they changed
24+
- id: get_hash
25+
run: echo "HASH=$(ls -l | md5sum ) | cut -d\ -f1)" >> $GITHUB_OUTPUT
1526
# build container image for package creation
16-
- run: docker pull ${{ env.cr_image }}:${{ github.job }} || docker build -t ${{ env.cr_image }}:${{ github.job }} -f dockerfiles/checkmk/Dockerfile .
17-
- run: docker push ${{ env.cr_image }}:${{ github.job }}
27+
- run: docker pull ${{ env.cr_image }}:${{ steps.get_hash.outputs.HASH }} || docker build -t ${{ env.cr_image }}:${{ steps.get_hash.outputs.HASH }} -f dockerfiles/checkmk/Dockerfile .
28+
- run: docker push ${{ env.cr_image }}:${{ steps.get_hash.outputs.HASH }}
1829

1930
# build-package:
2031
# runs-on: ubuntu-latest

0 commit comments

Comments
 (0)