Skip to content

fix workflow part IV #71

fix workflow part IV

fix workflow part IV #71

name: build-release-latest
on:
push:
tags-ignore: 'v*'
branches: '*'
env:
# ERROR: failed to build: invalid tag "ghcr.io/HenriWahl/checkmk-agent-plugin-yum/build:build-image": repository name must be lowercase
# this is the penalty for using uppercase letters in repository names...
cr_image: ghcr.io/henriwahl/checkmk-agent-plugin-yum/build:${{ github.run_id }}
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# docker login is needed for pushing the test image
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# somehow weird way to get the hash over the requirements to be aware if they changed
- id: get_hash
run: echo "HASH=$(ls -l | md5sum ) | cut -d\ -f1)" >> $GITHUB_OUTPUT
# build container image for package creation
- 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 .
- run: docker push ${{ env.cr_image }}:${{ steps.get_hash.outputs.HASH }}
# build-package:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# # build container image for package creation
# - run: /usr/bin/docker build -t ${{ github.job }} -f dockerfiles/checkmk/Dockerfile .
# # actually build .mkp file
# - run: /usr/bin/docker run --volume $PWD:/source ${{ github.job }}
# # upload results
# - uses: actions/upload-artifact@v4
# with:
# path: ./*.mkp
# retention-days: 1
# github-release:
# runs-on: ubuntu-latest
# needs: build-package
# steps:
# - uses: actions/download-artifact@v4
# - run: cd artifact && md5sum *.mkp > md5sums.txt
# - run: cd artifact && sha256sum *.mkp > sha256sums.txt
# - uses: marvinpinto/action-automatic-releases@latest
# with:
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
# automatic_release_tag: "latest"
# prerelease: true
# files: |
# artifact/*