From bff81639ce89e478f7c18a5ec3fa9ac082a5e61d Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Thu, 13 Oct 2022 18:01:15 -0500 Subject: [PATCH] ci: Publish docker image to Docker Hub https://hub.docker.com/r/recyclarr/recyclarr --- .github/workflows/build.yml | 1 + .github/workflows/docker.yml | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef6b76cb..2c6653b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -185,6 +185,7 @@ jobs: name: Docker needs: musl uses: ./.github/workflows/docker.yml + secrets: inherit # The main purpose of this job is to group all the other jobs together into one single job status # that can be set as a requirement to merge pull requests. This is easier than enumerating all diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index db51284b..743ee41f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -35,7 +35,9 @@ jobs: env: SEMVER: type=semver,enable=${{ steps.check_version.outputs.match }},value=${{ github.ref_name }} with: - images: ghcr.io/${{ github.repository }} + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} tags: | type=edge,branch=master ${{ env.SEMVER }},pattern={{major}}.{{minor}}.{{patch}} @@ -47,6 +49,13 @@ jobs: with: path: docker/artifacts + - name: Login to Docker Hub + if: env.SHOULD_PUBLISH + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GHCR if: env.SHOULD_PUBLISH uses: docker/login-action@v2 @@ -64,3 +73,11 @@ jobs: platforms: linux/arm/v7,linux/arm64,linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + - name: Update Docker Hub Description + uses: peter-evans/dockerhub-description@v3 + if: github.ref == 'refs/heads/master' + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + DOCKERHUB_REPOSITORY: ${{ github.repository }}