Skip to content
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8f6c0b8
Modified ci.yml to run without fail when there is no secrets
hanxizh9910 Sep 30, 2025
e7e44dc
Removed some space and fixed some comments
hanxizh9910 Oct 1, 2025
f282639
Used more descriptive names for the job and id
hanxizh9910 Oct 1, 2025
491dcb5
Added back the name for update docker description job
hanxizh9910 Oct 9, 2025
768d652
Test: expect all the versions pusing to dockerhub when merge to mainline
hanxizh9910 Oct 10, 2025
f475c50
Added filters to rebuild only the changed images
hanxizh9910 Sep 8, 2025
cdc2222
Removed a comment
hanxizh9910 Sep 23, 2025
2d13cd4
Removed a duplicated comment
hanxizh9910 Oct 8, 2025
a4e87b2
Added back original debugging aid
hanxizh9910 Oct 8, 2025
30cd931
Test: check if the modified images will be built
hanxizh9910 Oct 8, 2025
0fadad5
Check if both images will be built
hanxizh9910 Oct 8, 2025
959dd5c
Test: multiple files change and workflow will detect the modified doc…
hanxizh9910 Oct 8, 2025
c315973
revert the dummy changes
hanxizh9910 Oct 8, 2025
fe5a71b
Added a comment to check
hanxizh9910 Oct 8, 2025
c238710
modified readme
hanxizh9910 Oct 8, 2025
4973bc4
Avoid rebuilding the images if it is pushing to mainline
hanxizh9910 Oct 8, 2025
f2af212
revmoed a dummy change
hanxizh9910 Oct 8, 2025
b972e7d
Test: dockerfile change, expect only the 8.1 jobs to run when push to…
hanxizh9910 Oct 9, 2025
c205325
Test: multiple dockerfile changes, expect both 8.1 and 9.0 jobs to ru…
hanxizh9910 Oct 9, 2025
587bc0a
Test: Dummy change to ci.yml, expect all the jobs to run for PR and n…
hanxizh9910 Oct 9, 2025
8f9f9e3
Test: Expect all versions to push to dockerhub when merge to mainline
hanxizh9910 Oct 13, 2025
e9c3bd6
Merge pull request #25 from hanxizh9910/issue-23-clean
hanxizh9910 Oct 13, 2025
1762743
Test: reverted changes to both images, expect them to push to dockerhub
hanxizh9910 Oct 13, 2025
70bf3a1
Merge pull request #26 from hanxizh9910/issue-23-clean
hanxizh9910 Oct 13, 2025
f6124d5
Removed an error due to merge conflict issue before
hanxizh9910 Oct 13, 2025
5a0518f
Test: has secrets, expect all versions to be pushed when merging to m…
hanxizh9910 Oct 13, 2025
e0a8ffb
Merge pull request #27 from hanxizh9910/issue-23-clean
hanxizh9910 Oct 14, 2025
00827de
Test again, try to push the images when merge to the mainline
hanxizh9910 Oct 14, 2025
b9cf152
Merge pull request #28 from hanxizh9910/issue-23-clean
hanxizh9910 Oct 14, 2025
cf67691
Last test, removed secrets, and expect nothing to be pushed but not f…
hanxizh9910 Oct 14, 2025
47d3007
Fix: fix the error when multiple changed files were flattened to one …
hanxizh9910 Oct 14, 2025
97bc89c
Merge pull request #30 from hanxizh9910/issue-23-clean
hanxizh9910 Oct 15, 2025
f6923d0
Test: check if there is no dockerfile modified, expect: all the test …
hanxizh9910 Oct 15, 2025
e86349e
Merge pull request #31 from hanxizh9910/issue-23-clean
hanxizh9910 Oct 15, 2025
8a6469d
Test: has secrets, expect all tests to run for PR and push to mainlin
hanxizh9910 Oct 15, 2025
b467670
Merge pull request #32 from hanxizh9910/issue-23-clean
hanxizh9910 Oct 15, 2025
f1f87c7
Clean the dummy changes
hanxizh9910 Oct 16, 2025
bd0a770
Try to output the has-secrets in generate jobs
hanxizh9910 Oct 16, 2025
eecd743
Fix the expression error
hanxizh9910 Oct 16, 2025
22a4c89
Removed a dummy change from readme
hanxizh9910 Oct 16, 2025
06dba50
Merge branch 'mainline' into issue-23-clean
hanxizh9910 Oct 16, 2025
bea35ed
Fix used a wrong name for HAS_SECRETS
hanxizh9910 Oct 16, 2025
dab21b9
Test: has secrets, expect pushing to dockerhub
hanxizh9910 Oct 17, 2025
1672fb6
Test: no secrets, expect no test will fail
hanxizh9910 Oct 17, 2025
d3c1273
Removed some unnecessary checks
hanxizh9910 Oct 17, 2025
803bd57
Test: no secrets, expect no test fail
hanxizh9910 Oct 17, 2025
5e42210
Fix: added check to make sure when there is no secret
hanxizh9910 Oct 18, 2025
7ca2381
Update 8.1/debian/Dockerfile
roshkhatri Oct 18, 2025
7e14921
Update 8.1/alpine/Dockerfile
roshkhatri Oct 18, 2025
fcb79c6
Update 9.0/alpine/Dockerfile
roshkhatri Oct 18, 2025
c0ce38e
Update 9.0/debian/Dockerfile
roshkhatri Oct 18, 2025
97ecae0
Update Dockerfile.template
roshkhatri Oct 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

env:
IS_PULL: ${{ github.event_name == 'pull_request' }}
HAS_SECRETS: ${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' && secrets.DOCKERHUB_ACCOUNT != '' && secrets.DOCKERHUB_REPOSITORY != '' }}

defaults:
run:
Expand All @@ -23,6 +24,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
strategy: ${{ steps.generate-jobs.outputs.strategy }}
has-secrets: ${{ steps.generate-jobs.outputs.has-secrets }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -36,7 +38,7 @@ jobs:
# For pushes to mainline or PRs targeting mainline, only build changed versions
if [[ ("${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/mainline")]] ; then
changed_files=$(git diff --name-only HEAD~1 HEAD)
if echo $changed_files | grep -qE "^(versions\.json|[0-9]+\.[0-9]+/|unstable/)"; then
if printf "%s\n" "$changed_files" | grep -qE "^(versions\.json|[0-9]+\.[0-9]+/|unstable/)"; then
changed_versions=$(echo $changed_files | grep -oE "[0-9]+\.[0-9]+|unstable" | sort -u | tr '\n' '|' | sed 's/|$//')
if [[ -n "$changed_versions" ]]; then
strategy=$(jq -c --arg versions "$changed_versions" '{"fail-fast": .["fail-fast"],"matrix":{"include":[ .matrix.include[]|select(.meta.entries[0].directory | test($versions))]}}' <<<"$strategy")
Expand All @@ -47,8 +49,8 @@ jobs:
fi

echo "strategy=$(jq -c . <<<"$strategy")" >> "$GITHUB_OUTPUT"
echo "has-secrets=${{ env.HAS_SECRETS }}" >> "$GITHUB_OUTPUT"
jq . <<<"$strategy" # debugging aid to visually inspect the generated matrix

# Job to build and push Docker images individually for each architecture/platform
build_and_push:
needs: [generate-jobs]
Expand Down Expand Up @@ -78,6 +80,8 @@ jobs:
run: |
if [[ "${{ env.IS_PULL }}" == "true" ]]; then
echo "DOCKER_REPO_NAME=${{ github.actor }}/valkey-bundle" >> $GITHUB_ENV
elif [[ "${{ env.HAS_SECRETS }}" != "true" ]]; then
echo "DOCKER_REPO_NAME=${{ github.actor }}/valkey-bundle" >> $GITHUB_ENV
else
echo "DOCKER_REPO_NAME=${{ secrets.DOCKERHUB_ACCOUNT }}/valkey-bundle" >> $GITHUB_ENV
fi
Expand All @@ -89,7 +93,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: env.IS_PULL != 'true'
if: env.IS_PULL != 'true' && env.HAS_SECRETS == 'true'
uses: docker/login-action@v3
with:
registry: docker.io
Expand Down Expand Up @@ -120,8 +124,8 @@ jobs:
with:
file: ./${{ matrix.version.meta.entries[0].directory }}/Dockerfile
platforms: ${{ matrix.platform }}
# Push is true only for push events
push: ${{ env.IS_PULL != 'true' }}
# Push is true only for push events if the secrets have been created
push: ${{ env.HAS_SECRETS == 'true' && env.IS_PULL != 'true' }}
outputs: type=image,push-by-digest=true,name-canonical=true
tags: ${{ env.DOCKER_REPO_NAME }}
provenance: false
Expand Down Expand Up @@ -191,7 +195,7 @@ jobs:
steps:
- name: Set DOCKER_REPO_NAME dynamically
run: |
if [[ "${{ env.IS_PULL }}" == "true" ]]; then
if [[ "${{ env.IS_PULL }}" == "true" || "${{ env.HAS_SECRETS }}" != "true" ]]; then
echo "DOCKER_REPO_NAME=${{ github.actor }}/valkey-bundle" >> $GITHUB_ENV
else
echo "DOCKER_REPO_NAME=${{ secrets.DOCKERHUB_ACCOUNT }}/valkey-bundle" >> $GITHUB_ENV
Expand All @@ -212,14 +216,15 @@ jobs:
merge-multiple: false

- name: Login to Docker Hub
if: env.HAS_SECRETS == 'true' && env.IS_PULL != 'true'
uses: docker/login-action@v3
if: env.IS_PULL != 'true'
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
if: env.HAS_SECRETS == 'true'
uses: docker/setup-buildx-action@v3

# Use imagetools to combine the arch-specific digests into respective multi-arch manifest
Expand Down Expand Up @@ -273,16 +278,16 @@ jobs:
digest_args=$(printf "${{ env.DOCKER_REPO_NAME }}@sha256:%s " digests/$combo/*)
digest_args=${digest_args//digests\/$combo\//}

if [[ "${{ env.IS_PULL }}" == "true" ]]; then
if [[ "${{ env.IS_PULL }}" == "true" || "${{ env.HAS_SECRETS }}" != "true" ]]; then
echo "Dry run: docker buildx imagetools create $tag_args $digest_args"
else
docker buildx imagetools create $tag_args $digest_args
fi
done

update-dockerhub-description:
if: github.event_name == 'push' && github.ref == 'refs/heads/mainline'
needs: merge-manifest
if: github.event_name == 'push' && github.ref == 'refs/heads/mainline' && needs.generate-jobs.outputs.has-secrets == 'true'
needs: [merge-manifest, generate-jobs]
name: Update DockerHub Description
uses: ./.github/workflows/update-dockerhub-docs.yml
secrets:
Expand Down