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 +
+ Ready-to-use image for SSR rendering based on headless Chrome. +
----- - +[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: