66 branches :
77 - mainline
88 paths :
9- - ' **/Dockerfile'
9+ - " **/Dockerfile"
1010 workflow_dispatch :
1111
1212env :
1313 IS_PULL : ${{ github.event_name == 'pull_request' }}
14- HAS_SECRETS : ${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' && secrets.DOCKERHUB_ACCOUNT != '' && secrets.DOCKERHUB_REPOSITORY != '' }}
1514
1615defaults :
1716 run :
18- shell : ' bash -Eeuo pipefail -x {0}'
17+ shell : " bash -Eeuo pipefail -x {0}"
1918
2019jobs :
21-
2220 generate-jobs :
2321 name : Generate Jobs
2422 runs-on : ubuntu-latest
2523 outputs :
2624 strategy : ${{ steps.generate-jobs.outputs.strategy }}
27- has-secrets : ${{ steps.generate-jobs.outputs.has-secrets }}
2825 steps :
2926 - uses : actions/checkout@v4
3027 with :
@@ -49,11 +46,12 @@ jobs:
4946 fi
5047
5148 echo "strategy=$(jq -c . <<<"$strategy")" >> "$GITHUB_OUTPUT"
52- echo "has-secrets=${{ env.HAS_SECRETS }}" >> "$GITHUB_OUTPUT"
5349 jq . <<<"$strategy" # debugging aid to visually inspect the generated matrix
5450 # Job to build and push Docker images individually for each architecture/platform
5551 build_and_push :
5652 needs : [generate-jobs]
53+ env :
54+ HAS_SECRETS : ${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' && secrets.DOCKERHUB_ACCOUNT != '' && secrets.DOCKERHUB_REPOSITORY != '' }}
5755 strategy :
5856 fail-fast : false # continue other jobs even if one job fails
5957 matrix :
@@ -133,7 +131,7 @@ jobs:
133131 cache-from : type=gha
134132 cache-to : type=gha,mode=max
135133 pull : true
136-
134+
137135 - name : Prepare Environment
138136 run : ${{ matrix.version.runs.prepare }}
139137
@@ -149,37 +147,37 @@ jobs:
149147 - name : Set up Python
150148 uses : actions/setup-python@v4
151149 with :
152- python-version : ' 3.8'
150+ python-version : " 3.8"
153151
154- # Core + Module Integration Tests
152+ # Core + Module Integration Tests
155153 - name : All Core + Module Tests
156154 run : |
157155 matrix_version="${{ matrix.version.name }}"
158156 bundle_version=$(echo "$matrix_version" | cut -d'.' -f1-2)
159-
157+
160158 ./.test/tests/valkey-integration-tests/run.sh "${{ env.DOCKER_REPO_NAME }}" "$bundle_version"
161-
159+
162160 # Export digest to a file to reference it later in merging manifests
163161 - name : Export digest
164162 id : export-digest
165163 run : |
166164 mkdir -p ${{ runner.temp }}/digests
167165 digest="${{ steps.build.outputs.digest }}"
168166 touch "${{ runner.temp }}/digests/${digest#sha256:}"
169-
167+
170168 version="${{ matrix.version.name }}"
171169 major_minor=$(echo "$version" | cut -d'.' -f1-2)
172-
170+
173171 directory="${{ matrix.version.meta.entries[0].directory }}"
174172 if [[ "$directory" == *"alpine"* ]]; then
175173 distro="alpine"
176174 else
177175 distro="debian"
178176 fi
179-
177+
180178 echo "linux_distro=$distro" >> "$GITHUB_OUTPUT"
181179 echo "version_major_minor=$major_minor" >> "$GITHUB_OUTPUT"
182-
180+
183181 - name : Upload digest for version-distro combination
184182 uses : actions/upload-artifact@v4
185183 with :
@@ -192,6 +190,10 @@ jobs:
192190 merge-manifest :
193191 runs-on : ubuntu-latest
194192 needs : [generate-jobs, build_and_push]
193+ env :
194+ HAS_SECRETS : ${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' && secrets.DOCKERHUB_ACCOUNT != '' && secrets.DOCKERHUB_REPOSITORY != '' }}
195+ outputs :
196+ has-secrets : ${{ steps.output-has-secrets.outputs.has-secrets }}
195197 steps :
196198 - name : Set DOCKER_REPO_NAME dynamically
197199 run : |
@@ -201,6 +203,10 @@ jobs:
201203 echo "DOCKER_REPO_NAME=${{ secrets.DOCKERHUB_ACCOUNT }}/valkey-bundle" >> $GITHUB_ENV
202204 fi
203205
206+ - name : Output if User has set secrets
207+ id : output-has-secrets
208+ run : echo "has-secrets=${{ env.HAS_SECRETS }}" >> "$GITHUB_OUTPUT"
209+
204210 - name : Download All Digests
205211 uses : actions/download-artifact@v4
206212 with :
@@ -286,11 +292,11 @@ jobs:
286292 done
287293
288294 update-dockerhub-description :
289- if : github.event_name == 'push' && github.ref == 'refs/heads/mainline' && needs.generate-jobs .outputs.has-secrets == 'true'
295+ if : github.event_name == 'push' && github.ref == 'refs/heads/mainline' && needs.merge-manifest .outputs.has-secrets == 'true'
290296 needs : [merge-manifest, generate-jobs]
291297 name : Update DockerHub Description
292298 uses : ./.github/workflows/update-dockerhub-docs.yml
293299 secrets :
294300 DOCKERHUB_USERNAME : ${{ secrets.DOCKERHUB_USERNAME }}
295301 DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
296- DOCKERHUB_REPOSITORY : ${{ secrets.DOCKERHUB_REPOSITORY }}
302+ DOCKERHUB_REPOSITORY : ${{ secrets.DOCKERHUB_REPOSITORY }}
0 commit comments