Skip to content

Commit

Permalink
Merge pull request #38 from CCBR/dockerhub-desc
Browse files Browse the repository at this point in the history
ci: use dockerhub-description action
  • Loading branch information
kelly-sovacool authored Oct 30, 2024
2 parents ffe500a + 3b3ab86 commit 8b60d89
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/build-docker-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ jobs:
exit 1
fi
# 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
echo " # ${{ github.repository }} ${{ github.event.inputs.image_name }}" > tmp_README.md
echo "Dockerfile source: https://github.com/${{ github.repository }}/blob/${{ github.sha }}/${{ github.event.inputs.dockerfile }}" >> 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 }}
Expand All @@ -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
21 changes: 11 additions & 10 deletions .github/workflows/build-docker-meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ jobs:
exit 1
fi
# for Docker Hub Description
echo " # ${{ github.repository }} ${{ steps.metadata.outputs['image_name'] }}\n" > tmp_README.md
echo "Dockerfile source: https://github.com/${{ github.repository }}/blob/${{ github.sha }}/${{ github.event.inputs.context_dir }}/Dockerfile\n" >> tmp_README.md
echo " # ${{ github.repository }} ${{ steps.metadata.outputs['image_name'] }}" > tmp_README.md
echo "Dockerfile source: https://github.com/${{ github.repository }}/blob/${{ github.sha }}/${{ github.event.inputs.context_dir }}/Dockerfile" >> tmp_README.md
- name: Build and push
uses: docker/build-push-action@v4
id: build-and-push
# only try building & pushing the container if parsing the metadata worked
if: ${{ steps.metadata.outputs['container'] != '' }}
with:
Expand All @@ -54,11 +55,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

0 comments on commit 8b60d89

Please sign in to comment.