From 8042ec9b40212fb8821da23a00d709a7a3ed8460 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 29 Oct 2024 12:53:47 -0400 Subject: [PATCH] ci: use dockerhub-description action resolves #34 --- .github/workflows/build-docker-manual.yml | 17 +++++++++-------- .github/workflows/build-docker-meta.yml | 16 ++++++++-------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-docker-manual.yml b/.github/workflows/build-docker-manual.yml index da43e6b..df62ecb 100644 --- a/.github/workflows/build-docker-manual.yml +++ b/.github/workflows/build-docker-manual.yml @@ -53,6 +53,7 @@ jobs: 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 + id: build-and-push with: context: ${{ steps.vars.outputs.CONTEXT }} file: ${{ github.event.inputs.dockerfile }} @@ -62,11 +63,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: ${{ steps.metadata.outputs['dockerhub_namespace'] }}/${{ steps.metadata.outputs['image_name'] }} - # readme-filepath: tmp_README.md + - name: Update Docker Hub Description + if: ${{ (github.event.inputs.push == 'true') && (steps.build-and-push.outcome == 'success') }} + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ steps.metadata.outputs['dockerhub_namespace'] }}/${{ steps.metadata.outputs['image_name'] }} + readme-filepath: tmp_README.md diff --git a/.github/workflows/build-docker-meta.yml b/.github/workflows/build-docker-meta.yml index 0e9bee0..dd67cfe 100644 --- a/.github/workflows/build-docker-meta.yml +++ b/.github/workflows/build-docker-meta.yml @@ -54,11 +54,11 @@ jobs: BUILD_DATE=${{ steps.vars.outputs.DATE }} BUILD_TAG=${{ steps.metadata.outputs['version'] }} REPONAME=${{ steps.metadata.outputs['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: ${{ steps.metadata.outputs['dockerhub_namespace'] }}/${{ steps.metadata.outputs['image_name'] }} - # readme-filepath: tmp_README.md + - name: Update Docker Hub Description + if: ${{ (github.event.inputs.push == 'true') && (steps.build-and-push.outcome == 'success') }} + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ steps.metadata.outputs['dockerhub_namespace'] }}/${{ steps.metadata.outputs['image_name'] }} + readme-filepath: tmp_README.md