diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cb6895e..465f8c5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,6 +10,7 @@ on: env: IMAGE: ghcr.io/ivenos/compwire + DOCKERHUB_IMAGE: ivenos/compwire jobs: test: @@ -63,11 +64,19 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to Docker Hub + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Docker meta id: meta uses: docker/metadata-action@v6 with: - images: ${{ env.IMAGE }} + images: | + ${{ env.IMAGE }} + docker.io/${{ env.DOCKERHUB_IMAGE }} tags: | type=raw,value=dev,enable=${{ github.ref == 'refs/heads/main' }} type=semver,pattern={{version}} @@ -84,3 +93,16 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + - name: Prepare Docker Hub README + run: | + printf '**Note:** This description is automatically generated from the [GitHub repository README](https://github.com/ivenos/compwire).\n\n---\n\n' \ + | cat - README.md > /tmp/dockerhub-readme.md + + - name: Update Docker Hub description + uses: peter-evans/dockerhub-description@v5 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ env.DOCKERHUB_IMAGE }} + readme-filepath: /tmp/dockerhub-readme.md +