From 2ea6a7638296e5c38888d367bae924ebc9efb3bb Mon Sep 17 00:00:00 2001 From: SandObserver <260779319+SandObserver@users.noreply.github.com> Date: Sat, 17 Oct 2026 11:40:48 -0400 Subject: [PATCH] Add: publish the image to Docker Hub The release pushes the same tags to docker.io/sandobserver/posteryard and then rewrites the Docker Hub page from README.md. The page update is its own workflow, so it also runs by hand. tools/dockerhub_description.py makes the links absolute, drops HTML that Docker Hub shows as text, names the Docker Hub image in commands and adds the image tags for the current version. --- .github/workflows/dockerhub.yml | 34 ++++++++++++ .github/workflows/release.yml | 16 +++++- CHANGELOG.md | 4 ++ CONTRIBUTING.md | 2 +- README.md | 3 +- tests/test_dockerhub.py | 58 +++++++++++++++++++++ tools/dockerhub_description.py | 91 +++++++++++++++++++++++++++++++++ 7 files changed, 205 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/dockerhub.yml create mode 100644 tests/test_dockerhub.py create mode 100644 tools/dockerhub_description.py diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml new file mode 100644 index 0000000..8f60b88 --- /dev/null +++ b/.github/workflows/dockerhub.yml @@ -0,0 +1,34 @@ +name: Docker Hub page + +on: + workflow_dispatch: + workflow_call: + secrets: + DOCKERHUB_TOKEN: + required: true + +permissions: + contents: read + +jobs: + page: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - run: python3 tools/dockerhub_description.py > dockerhub.md + - name: Check the token can push + uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 + with: + registry: docker.io + username: sandobserver + password: ${{ secrets.DOCKERHUB_TOKEN }} + # The token needs Read, Write and Delete. With Read and Write the page update returns 403. + - uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0 + with: + username: sandobserver + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: sandobserver/posteryard + readme-filepath: dockerhub.md + short-description: Clean, consistent posters for Plex, Jellyfin and Emby, rendered and kept current automatically. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5535d4e..0eb3c9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,10 +50,17 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 + with: + registry: docker.io + username: sandobserver + password: ${{ secrets.DOCKERHUB_TOKEN }} - id: meta uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 with: - images: ghcr.io/sandobserver/posteryard + images: | + ghcr.io/sandobserver/posteryard + docker.io/sandobserver/posteryard tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} @@ -84,3 +91,10 @@ jobs: [[ "$GITHUB_REF_NAME" == *-* ]] && prerelease=(--prerelease) gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --title "$GITHUB_REF_NAME" \ --notes-file notes.md --verify-tag "${prerelease[@]}" + + dockerhub-page: + needs: release + if: ${{ !contains(github.ref_name, '-') }} + uses: ./.github/workflows/dockerhub.yml + secrets: + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 6263ca7..2b9eea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ## [Unreleased] +### Added + +- Publish the image to Docker Hub as `sandobserver/posteryard` too, with the same tags as ghcr.io. + ### Changed - Give a Live TV title without art its channel's logo large over the logo's blurred colours, in place of the title on dark grey. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 528b769..d246510 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -118,4 +118,4 @@ The Plex preview shows either 12 random movies or 12 random shows from `site/pos ## Releases -Semantic versioning. Move the `Unreleased` entries in [CHANGELOG.md](CHANGELOG.md) under the new version with its date, set `version` in `pyproject.toml`, run `uv run python tools/unraid_template.py` to copy the notes into the Unraid template, merge, and push a `vX.Y.Z` tag. The tag runs the CI checks, then pushes `ghcr.io/sandobserver/posteryard:X.Y.Z`, `:X.Y` and `:latest`, and publishes a GitHub release with the version's CHANGELOG section. The release stops if the tag, `pyproject.toml` and a dated CHANGELOG section do not agree. The image carries an SBOM and build provenance. A tag with a suffix, such as `v1.0.0-rc.1`, publishes a prerelease: only the `1.0.0-rc.1` image tag, and a GitHub release marked as prerelease. +Semantic versioning. Move the `Unreleased` entries in [CHANGELOG.md](CHANGELOG.md) under the new version with its date, set `version` in `pyproject.toml`, run `uv run python tools/unraid_template.py` to copy the notes into the Unraid template, merge, and push a `vX.Y.Z` tag. The tag runs the CI checks, then pushes `X.Y.Z`, `X.Y` and `latest` to `ghcr.io/sandobserver/posteryard` and `docker.io/sandobserver/posteryard`, publishes a GitHub release with the version's CHANGELOG section, and rewrites the Docker Hub page from `README.md` with `tools/dockerhub_description.py`. Docker Hub needs the repository secret `DOCKERHUB_TOKEN`, an access token with Read, Write and Delete. Docker Hub refuses to move an `X.Y.Z` tag, so a version cannot be published twice. The `Docker Hub page` workflow updates the page by hand. The release stops if the tag, `pyproject.toml` and a dated CHANGELOG section do not agree. The image carries an SBOM and build provenance. A tag with a suffix, such as `v1.0.0-rc.1`, publishes a prerelease: only the `1.0.0-rc.1` image tag, and a GitHub release marked as prerelease. diff --git a/README.md b/README.md index 6e18eae..536386c 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@
