Skip to content

Commit

Permalink
Merge pull request #17 from theohbrothers/enhancement/bump-pagefind-1…
Browse files Browse the repository at this point in the history
….1-variants-to-1.1.1

Enhancement: Bump pagefind 1.1 variants to 1.1.1
  • Loading branch information
theohbrothersbot authored Dec 29, 2024
2 parents 6311727 + 3367b9a commit ec6105b
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 23 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/ci-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ jobs:
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
build-1-1-0:
build-1-1-1:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -303,9 +303,9 @@ jobs:
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-1.1.0-${{ github.sha }}
key: ${{ runner.os }}-buildx-1.1.1-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-1.1.0-
${{ runner.os }}-buildx-1.1.1-
${{ runner.os }}-buildx-
- name: Login to Docker Hub registry
Expand All @@ -318,7 +318,7 @@ jobs:

# This step generates the docker tags
- name: Prepare
id: prep-1-1-0
id: prep-1-1-1
run: |
set -e
Expand All @@ -331,7 +331,7 @@ jobs:
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="1.1.0"
VARIANT="1.1.1"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
Expand All @@ -341,45 +341,45 @@ jobs:
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: 1.1.0 - Build (PRs)
- name: 1.1.1 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: variants/1.1.0
context: variants/1.1.1
platforms: linux/386,linux/amd64,linux/arm64
push: false
tags: |
${{ github.repository }}:${{ steps.prep-1-1-0.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-0.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-1.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-1.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.1.0 - Build and push (master)
- name: 1.1.1 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v5
with:
context: variants/1.1.0
context: variants/1.1.1
platforms: linux/386,linux/amd64,linux/arm64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-1-0.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-0.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-1.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-1.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.1.0 - Build and push (release)
- name: 1.1.1 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: variants/1.1.0
context: variants/1.1.1
platforms: linux/386,linux/amd64,linux/arm64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-1-0.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-0.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-0.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-1.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-1.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-1-1.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

Expand Down Expand Up @@ -514,7 +514,7 @@ jobs:
needs:
- build-1-3-0
- build-1-2-0
- build-1-1-0
- build-1-1-1
- build-1-0-4
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
Expand All @@ -531,7 +531,7 @@ jobs:
needs:
- build-1-3-0
- build-1-2-0
- build-1-1-0
- build-1-1-1
- build-1-0-4
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
Expand All @@ -550,7 +550,7 @@ jobs:
needs:
- build-1-3-0
- build-1-2-0
- build-1-1-0
- build-1-1-1
- build-1-0-4
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Dockerized [pagefind](https://github.com/CloudCannon/pagefind).
|:-------:|:---------:|
| `:1.3.0`, `:latest` | [View](variants/1.3.0) |
| `:1.2.0` | [View](variants/1.2.0) |
| `:1.1.0` | [View](variants/1.1.0) |
| `:1.1.1` | [View](variants/1.1.1) |
| `:1.0.4` | [View](variants/1.0.4) |

## Usage
Expand Down
2 changes: 1 addition & 1 deletion generate/definitions/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"versions": [
"1.3.0",
"1.2.0",
"1.1.0",
"1.1.1",
"1.0.4"
],
"versionsChangeScope": "minor",
Expand Down
39 changes: 39 additions & 0 deletions variants/1.1.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM alpine:3.17
# Install pagefind_extended
RUN set -eux; \
PAGEFIND_EXTENDED_VERSION=v1.1.1; \
case "$( uname -m )" in \
'x86') \
URL="https://github.com/CloudCannon/pagefind/releases/download/v1.1.1/pagefind_extended-v1.1.1-x86_64-unknown-linux-musl.tar.gz"; \
SHA256=6b1deb1621303d8f75f8ea31591a5c862e8dc3302122b60abd97601057621925; \
;; \
'x86_64') \
URL="https://github.com/CloudCannon/pagefind/releases/download/v1.1.1/pagefind_extended-v1.1.1-x86_64-unknown-linux-musl.tar.gz"; \
SHA256=6b1deb1621303d8f75f8ea31591a5c862e8dc3302122b60abd97601057621925; \
;; \
'aarch64') \
URL="https://github.com/CloudCannon/pagefind/releases/download/v1.1.1/pagefind_extended-v1.1.1-aarch64-unknown-linux-musl.tar.gz"; \
SHA256=c393ff468b8b61ad92cef291395c22537456856026b4d7e750b52282a4e00e82; \
;; \
*) \
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" ]
8 changes: 8 additions & 0 deletions variants/1.1.1/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pagefind_extended "$@"
fi

exec "$@"

0 comments on commit ec6105b

Please sign in to comment.