From f3d6042904d37039cf7d5707ff0e817b7e2adb13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Felix=20=C5=A0ulc?= Date: Sun, 25 Oct 2026 20:39:54 +0100 Subject: [PATCH] CI: versions like tika Key=value VERSION, one inline build job pushing all tags, simpler README with a Versions table. --- .github/workflows/docker.yml | 35 +++++++++++++---------- Makefile | 7 ++--- README.md | 55 ++++++++++++++++++++++++++---------- VERSION | 2 +- 4 files changed, 64 insertions(+), 35 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e1490ef..c6bd6a9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,7 +10,7 @@ permissions: contents: read jobs: - docker: + build: runs-on: ubuntu-latest strategy: matrix: @@ -34,13 +34,7 @@ jobs: - name: Read VERSION id: version - run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT" - - - name: Login to DockerHub - uses: docker/login-action@v4 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + run: cat VERSION >> "$GITHUB_OUTPUT" - name: Set up QEMU uses: docker/setup-qemu-action@v4 @@ -48,19 +42,28 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 + - name: Login to DockerHub + if: github.ref == 'refs/heads/master' + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push uses: docker/build-push-action@v7 with: - context: ${{ matrix.context }} - push: true + context: ${{ matrix.context }} + platforms: linux/amd64 # linux/arm64 + push: ${{ github.ref == 'refs/heads/master' }} tags: | dockette/rendertron:${{ matrix.tag }} - ${{ matrix.tag == 'latest' && format('dockette/rendertron:{0}', steps.version.outputs.version) || '' }} - platforms: linux/amd64 # linux/arm64 + ${{ matrix.tag == 'latest' && format('dockette/rendertron:{0}', steps.version.outputs.VERSION) || '' }} + cache-from: type=gha + cache-to: type=gha,mode=max release: name: "Release" - needs: docker + needs: build if: github.ref == 'refs/heads/master' && github.event_name == 'push' runs-on: ubuntu-latest permissions: @@ -72,11 +75,13 @@ jobs: - name: Create release env: GH_TOKEN: ${{ github.token }} - run: gh release view "$(cat VERSION)" || gh release create "$(cat VERSION)" --generate-notes + run: | + . ./VERSION + gh release view "$VERSION" || gh release create "$VERSION" --generate-notes docs: name: "Docs" - needs: docker + needs: build if: github.ref == 'refs/heads/master' uses: dockette/.github/.github/workflows/dockerhub-description.yml@master secrets: inherit diff --git a/Makefile b/Makefile index 20cfca3..a9421f7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION:=$(shell cat VERSION) +include VERSION build-rendertron: docker build -t dockette/rendertron ./rendertron @@ -41,6 +41,5 @@ version: .PHONY: release release: - @date -u +%Y.%m.%d > VERSION - @echo "VERSION: ${VERSION} -> $$(cat VERSION)" - @echo "next: git commit -am \"Release: $$(cat VERSION)\" && git push" + @sed -i.bak "s/^VERSION=.*/VERSION=$$(date -u +%Y.%m.%d)/" VERSION && rm VERSION.bak + @cat VERSION diff --git a/README.md b/README.md index 1b99e4b..9df4b2e 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,28 @@ -# Rendertron +

Dockette / Rendertron

-Ready-to-use image for SSR rendering based on headless Chrome, [a.k.a Rendertron by Google](https://github.com/GoogleChrome/rendertron). - -> All credits belong to the authors of [GoogleChrome/rendertron](https://github.com/GoogleChrome/rendertron). +

+ GitHub Actions + Docker Hub pulls + GitHub Sponsors + Support/Discussions +

-> **Upstream status:** the [GoogleChrome/rendertron](https://github.com/GoogleChrome/rendertron) project was archived and the upstream README marks it as deprecated. The image here is kept for existing users and the demo screenshot; new projects should evaluate the alternative rendering strategies linked from the upstream README before adopting Rendertron. +

+ Ready-to-use image for SSR rendering based on headless Chrome. +

----- -

- GitHub Actions - Docker Hub pulls - GitHub Sponsors - Support/Discussions -

+[Rendertron](https://github.com/GoogleChrome/rendertron) by Google on headless Chrome. All credits belong to the authors +of [GoogleChrome/rendertron](https://github.com/GoogleChrome/rendertron). + +The upstream project is archived and its README marks it as deprecated. This image is kept for existing users and the +demo screenshot. New projects should check the alternative rendering strategies linked from the upstream README before +they use Rendertron. ## Usage -``` +```sh docker run -it --rm -p 3000:3000 dockette/rendertron ``` @@ -25,9 +30,29 @@ docker run -it --rm -p 3000:3000 dockette/rendertron ## Versions -The release version is the date in [`VERSION`](VERSION). CI pushes `latest` also as `dockette/rendertron:`. -To release, run `make release`, commit and push to `master`. +| Version | Release | +|---------|---------| +| `dockette/rendertron:YYYY.MM.DD` | release `YYYY.MM.DD` | +| `dockette/rendertron:latest` | latest build of `master`, Rendertron on Node.js 20 and Chromium | +| `dockette/rendertron:proxy` | latest build of `master`, nginx proxy in front of Rendertron | +| `dockette/rendertron:tracer` | latest build of `master`, PHP CLI tracer that renders sitemap pages | + +Only `latest` has release tags. Releases are listed on [GitHub](https://github.com/dockette/rendertron/releases). + +## Development + +```sh +make build-rendertron # build dockette/rendertron +make build-proxy # build dockette/rendertron:proxy +make build-tracer # build dockette/rendertron:tracer +make run-rendertron # run Rendertron on port 3000 +make run-proxy # run the proxy on port 4000, NGINX_PROXY points to Rendertron +make run-tracer # run the tracer against a Rendertron server and sitemaps +make version # print VERSION +make release # set today's date in VERSION +``` ## Maintenance -See [how to contribute](https://github.com/dockette/.github/blob/master/CONTRIBUTING.md) to this package. Consider to [support](https://github.com/sponsors/f3l1x) **f3l1x**. Thank you for using this package. +See [how to contribute](https://github.com/dockette/.github/blob/master/CONTRIBUTING.md) to this package. Consider to +[support](https://github.com/sponsors/f3l1x) **f3l1x**. Thank you for using this package. diff --git a/VERSION b/VERSION index 7387f12..c353908 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2026.10.23 +VERSION=2026.10.23