diff --git a/.github/workflows/build-docker-manual.yml b/.github/workflows/build-docker-manual.yml index 0bfd53f..6d0bbdf 100644 --- a/.github/workflows/build-docker-manual.yml +++ b/.github/workflows/build-docker-manual.yml @@ -41,8 +41,16 @@ jobs: - name: Prepare build-time variables id: vars run: | + if [ ! -f ${{ github.event.inputs.dockerfile }} ] ; then + echo "ERROR: Dockerfile not found: ${{ github.event.inputs.dockerfile }}" + exit 1 + fi echo "CONTEXT=$(dirname ${{ github.event.inputs.dockerfile }})" >> "$GITHUB_OUTPUT" echo "DATE=$(date +"%Y-%m-%d")" >> "$GITHUB_OUTPUT" + + $ for Docker Hub Description + echo " # ${{ github.repository }} ${{ github.event.inputs.image_name }}\n" > tmp_README.md + echo "Dockerfile source: https://github.com/${{ github.repository }}/blob/${{ github.sha }}/${{ github.event.inputs.dockerfile }}\n" >> tmp_README.md - name: Build and push uses: docker/build-push-action@v4 with: @@ -54,3 +62,11 @@ jobs: BUILD_DATE=${{ steps.vars.outputs.DATE }} BUILD_TAG=${{ github.event.inputs.version }} REPONAME=${{ github.event.inputs.image_name }} + - name: Update Docker Hub Description + if: ${{ github.event.inputs.push == 'true' }} + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: peterevans/dockerhub-description + readme-filepath: tmp_README.md