diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 020a305..bd3edc5 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -33,7 +33,7 @@ jobs: run: | git diff --exit-code - build-1-0-3: + build-1-0-4: runs-on: ubuntu-latest steps: - name: Checkout @@ -64,9 +64,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-1.0.3-${{ github.sha }} + key: ${{ runner.os }}-buildx-1.0.4-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx-1.0.3- + ${{ runner.os }}-buildx-1.0.4- ${{ runner.os }}-buildx- - name: Login to Docker Hub registry @@ -79,7 +79,7 @@ jobs: # This step generates the docker tags - name: Prepare - id: prep-1-0-3 + id: prep-1-0-4 run: | set -e @@ -92,7 +92,7 @@ jobs: # Generate docker image tags # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' # E.g. 'master-' and 'master-abc0123-' - VARIANT="1.0.3" + VARIANT="1.0.4" REF_VARIANT="${REF}-${VARIANT}" REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" @@ -102,45 +102,45 @@ jobs: echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT - - name: 1.0.3 - Build (PRs) + - name: 1.0.4 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' uses: docker/build-push-action@v3 with: - context: variants/1.0.3 + context: variants/1.0.4 platforms: linux/386,linux/amd64,linux/arm64 push: false tags: | - ${{ github.repository }}:${{ steps.prep-1-0-3.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-1-0-3.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-1-0-4.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-1-0-4.outputs.REF_SHA_VARIANT }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - name: 1.0.3 - Build and push (master) + - name: 1.0.4 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' uses: docker/build-push-action@v3 with: - context: variants/1.0.3 + context: variants/1.0.4 platforms: linux/386,linux/amd64,linux/arm64 push: true tags: | - ${{ github.repository }}:${{ steps.prep-1-0-3.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-1-0-3.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-1-0-4.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-1-0-4.outputs.REF_SHA_VARIANT }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - name: 1.0.3 - Build and push (release) + - name: 1.0.4 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') uses: docker/build-push-action@v3 with: - context: variants/1.0.3 + context: variants/1.0.4 platforms: linux/386,linux/amd64,linux/arm64 push: true tags: | - ${{ github.repository }}:${{ steps.prep-1-0-3.outputs.VARIANT }} - ${{ github.repository }}:${{ steps.prep-1-0-3.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-1-0-3.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-1-0-4.outputs.VARIANT }} + ${{ github.repository }}:${{ steps.prep-1-0-4.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-1-0-4.outputs.REF_SHA_VARIANT }} ${{ github.repository }}:latest cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max @@ -155,7 +155,7 @@ jobs: update-draft-release: needs: - - build-1-0-3 + - build-1-0-4 if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: @@ -169,7 +169,7 @@ jobs: publish-draft-release: needs: - - build-1-0-3 + - build-1-0-4 if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: @@ -185,7 +185,7 @@ jobs: update-dockerhub-description: needs: - - build-1-0-3 + - build-1-0-4 if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 731d3f4..9a7484e 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ Dockerized [pagefind](https://github.com/CloudCannon/pagefind). | Tag | Dockerfile Build Context | |:-------:|:---------:| -| `:1.0.3`, `:latest` | [View](variants/1.0.3) | +| `:1.0.4`, `:latest` | [View](variants/1.0.4) | ## Usage Mount the public directory into the container at `/public`. ```sh -docker run --rm -it -v $(pwd)/public:/public theohbrothers/docker-pagefind:1.0.3 +docker run --rm -it -v $(pwd)/public:/public theohbrothers/docker-pagefind:1.0.4 ``` ## Development diff --git a/generate/definitions/versions.json b/generate/definitions/versions.json index 79356f5..066839a 100644 --- a/generate/definitions/versions.json +++ b/generate/definitions/versions.json @@ -1,7 +1,7 @@ { "pagefind": { "versions": [ - "1.0.3" + "1.0.4" ], "versionsChangeScope": "minor", "versionsNewScript": "Invoke-WebRequest https://api.github.com/repos/CloudCannon/pagefind/git/refs/tags | ConvertFrom-Json | % { $_.ref -replace 'refs/tags/v', '' } | ? { $_ -match '^\\d+\\.\\d+\\.\\d+$' } | Sort-Object { [version]$_ } -Descending | ? { [version]$_ -ge [version]'1.0' }" diff --git a/variants/1.0.4/Dockerfile b/variants/1.0.4/Dockerfile new file mode 100644 index 0000000..68f63e5 --- /dev/null +++ b/variants/1.0.4/Dockerfile @@ -0,0 +1,39 @@ +FROM alpine:3.17 +# Install pagefind_extended +RUN set -eux; \ + PAGEFIND_EXTENDED_VERSION=v1.0.4; \ + case "$( uname -m )" in \ + 'x86') \ + URL="https://github.com/CloudCannon/pagefind/releases/download/v1.0.4/pagefind_extended-v1.0.4-x86_64-unknown-linux-musl.tar.gz"; \ + SHA256=61cdee630d3fbb30763a982ed0c895731d143d6c60a96c37f261aba4837cb930; \ + ;; \ + 'x86_64') \ + URL="https://github.com/CloudCannon/pagefind/releases/download/v1.0.4/pagefind_extended-v1.0.4-x86_64-unknown-linux-musl.tar.gz"; \ + SHA256=61cdee630d3fbb30763a982ed0c895731d143d6c60a96c37f261aba4837cb930; \ + ;; \ + 'aarch64') \ + URL="https://github.com/CloudCannon/pagefind/releases/download/v1.0.4/pagefind_extended-v1.0.4-aarch64-unknown-linux-musl.tar.gz"; \ + SHA256=f450a5bb1f372fbf140fa59bdd0fc424900b7317f67f82538286ccf90e6498de; \ + ;; \ + *) \ + echo "Architecture not supported"; \ + exit 1; \ + ;; \ + esac; \ + FILE=pagefind_extended.tar.gz; \ + wget -q "$URL" -O "$FILE"; \ + echo "$SHA256 $FILE" | sha256sum -c -; \ + tar -xvf "$FILE" --no-same-owner --no-same-permissions -- pagefind_extended; \ + rm -f "$FILE"; \ + mkdir -pv /usr/local/bin; \ + mv -v pagefind_extended /usr/local/bin/pagefind_extended; \ + chmod +x /usr/local/bin/pagefind_extended; \ + pagefind_extended --version; \ + : + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x docker-entrypoint.sh + +WORKDIR / +ENTRYPOINT [ "/docker-entrypoint.sh" ] +CMD [ "pagefind_extended", "--site", "/public" ] \ No newline at end of file diff --git a/variants/1.0.4/docker-entrypoint.sh b/variants/1.0.4/docker-entrypoint.sh new file mode 100644 index 0000000..28d1942 --- /dev/null +++ b/variants/1.0.4/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then + set -- pagefind_extended "$@" +fi + +exec "$@" \ No newline at end of file