-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f067169
Showing
15 changed files
with
1,261 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
exclude: | ||
- main | ||
- stable | ||
- develop | ||
delete_closed_pr: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: dependency-updates | ||
on: | ||
push: | ||
branches: | ||
- latest | ||
schedule: | ||
- cron: "0 */6 * * *" | ||
workflow_dispatch: | ||
jobs: | ||
valkey-update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: update valkey version | ||
id: update | ||
run: | | ||
VALKEY_VERSION="$( | ||
git ls-remote --tags https://github.com/valkey-io/valkey \ | ||
| cut -d/ -f3 \ | ||
| grep -v redis \ | ||
| sort -V \ | ||
| tail -1 | ||
)" | ||
sed -i "s|ARG VALKEY_VERSION=.*|ARG VALKEY_VERSION=$VALKEY_VERSION|" Dockerfile | ||
echo "version=$VALKEY_VERSION" >> $GITHUB_OUTPUT | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
signoff: true | ||
delete-branch: true | ||
commit-message: update valkey version to ${{ steps.update.outputs.version }} | ||
branch: update-valkey-version | ||
title: update valkey version to ${{ steps.update.outputs.version }} | ||
body: update valkey version to ${{ steps.update.outputs.version }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Docker push develop to latest | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Convert Username | ||
id: un | ||
run: echo "un=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ steps.un.outputs.un }} | ||
password: ${{ github.token }} | ||
- name: Push develop to latest | ||
run: | | ||
docker buildx imagetools create --tag ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:latest ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.ref_name }} | ||
docker buildx imagetools create --tag ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:latest ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.ref_name }} | ||
- name: show version | ||
run: | | ||
docker run --rm ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:latest -V | ||
docker run --rm ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:latest -V | ||
- name: mark latest prerelease as latest | ||
run: | | ||
curl -X PATCH --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/$(curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases | jq -r '.[] | select(.prerelease == true) | .id' | head -1) -d '{"prerelease": false}' | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Build Docker Image | ||
on: | ||
push: | ||
paths: | ||
- Dockerfile | ||
- .github/workflows/docker.yml | ||
pull_request: | ||
paths: | ||
- Dockerfile | ||
- .github/workflows/docker.yml | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Read version | ||
id: version | ||
run: echo "version=$(echo valkey-$(cat Dockerfile | grep -wE "ARG VALKEY_VERSION=*" | sed "s|ARG VALKEY_VERSION=||g"))" >> $GITHUB_OUTPUT | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: arm64 #all | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=-1 | ||
- name: Login to DockerHub | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Convert Username | ||
id: un | ||
run: echo "un=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ steps.un.outputs.un }} | ||
password: ${{ github.token }} | ||
- name: Build | ||
uses: docker/build-push-action@v5 | ||
if: ${{ github.event_name != 'pull_request' }} | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64 #,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 | ||
push: ${{ github.ref == 'refs/heads/latest' }} | ||
tags: | | ||
${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.ref_name }} | ||
${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.run_number }} | ||
ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.ref_name }} | ||
ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.run_number }} | ||
- name: show version | ||
if: ${{ github.ref == 'refs/heads/latest' }} | ||
run: | | ||
docker run --rm ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.ref_name }} -V | ||
docker run --rm ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.ref_name }} -V | ||
- name: copy valkey binary | ||
if: ${{ github.ref == 'refs/heads/latest' }} | ||
run: | | ||
docker run -d --pull always --platform amd64 --name valkey-x86_64 ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.ref_name }} | ||
docker cp valkey-x86_64:/usr/local/bin/valkey-server valkey-server-x86_64 | ||
docker run -d --pull always --platform arm64 --name valkey-aarch64 ${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ github.ref_name }} | ||
docker cp valkey-aarch64:/usr/local/bin/valkey-server valkey-server-aarch64 | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ github.ref == 'refs/heads/latest' }} | ||
with: | ||
name: artifacts | ||
path: | | ||
valkey-server-x86_64 | ||
valkey-server-aarch64 | ||
- uses: crowbarmaster/GH-Automatic-Releases@latest | ||
if: ${{ github.ref == 'refs/heads/latest' }} | ||
with: | ||
prerelease: false | ||
repo_token: ${{ github.token }} | ||
title: ${{ steps.version.outputs.version }} | ||
automatic_release_tag: ${{ steps.version.outputs.version }} | ||
files: | | ||
valkey-server-x86_64 | ||
valkey-server-aarch64 | ||
- name: Set PR-Number (PR) | ||
if: ${{ github.event_name == 'pull_request' }} | ||
id: pr | ||
run: echo "pr=$(echo pr-${{ github.ref_name }} | sed "s|refs/pull/:||g" | sed "s|/merge||g")" >> $GITHUB_OUTPUT | ||
- name: Build (PR) | ||
uses: docker/build-push-action@v5 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64 #,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 | ||
push: ${{ github.event_name == 'pull_request' }} | ||
tags: ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ steps.pr.outputs.pr }} | ||
- name: show version (PR) | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: docker run --rm ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ steps.pr.outputs.pr }} -V | ||
- name: copy valkey binary (PR) | ||
if: ${{ github.ref == 'refs/heads/latest' }} | ||
run: | | ||
docker run -d --pull always --platform amd64 --name valkey-x86_64 ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ steps.pr.outputs.pr }} | ||
docker cp valkey-x86_64:/usr/local/bin/valkey-server valkey-server-x86_64 | ||
docker run -d --pull always --platform arm64 --name valkey-aarch64 ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ steps.pr.outputs.pr }} | ||
docker cp valkey-aarch64:/usr/local/bin/valkey-server valkey-server-aarch64 | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ github.ref == 'refs/heads/latest' }} | ||
with: | ||
name: artifacts | ||
path: | | ||
valkey-server-x86_64 | ||
valkey-server-aarch64 | ||
- name: add comment (PR) | ||
uses: mshick/add-pr-comment@v2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
message: "The Docker Image can now be found here: `ghcr.io/${{ steps.un.outputs.un }}/${{ github.event.repository.name }}:${{ steps.pr.outputs.pr }}`" | ||
repo-token: ${{ github.token }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Dockerlint | ||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
jobs: | ||
docker-lint: | ||
runs-on: ubuntu-latest | ||
name: docker-lint | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install hadolint | ||
run: | | ||
sudo wget https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 -O /usr/bin/hadolint | ||
sudo chmod +x /usr/bin/hadolint | ||
- name: run lint | ||
run: | | ||
DOCKERFILES="$(find . -name "*Dockerfile*")" | ||
for file in $(echo "$DOCKERFILES" | tr " " "\n"); do | ||
# DL3003 warning: Use WORKDIR to switch to a directory | ||
# DL3018 warning: Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>` | ||
# DL3013 warning: Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>` | ||
hadolint "$file" --ignore DL3003 --ignore DL3013 --ignore DL3018 | tee -a hadolint.log | ||
done | ||
if grep -q "DL[0-9]\+\|SC[0-9]\+" hadolint.log; then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: JSON check | ||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
jobs: | ||
test-json: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: json-syntax-check | ||
uses: limitusus/json-syntax-check@v2 | ||
with: | ||
pattern: "\\.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: spellcheck | ||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
jobs: | ||
spellcheck: | ||
name: spellcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code. | ||
uses: actions/checkout@v4 | ||
- name: Check spelling | ||
uses: codespell-project/actions-codespell@v2 | ||
with: | ||
check_filenames: true | ||
check_hidden: true | ||
skip: .git,.gitignore |
Oops, something went wrong.