Skip to content

Commit 1540b5b

Browse files
authored
Merge pull request #1594 from o1-labs/dw/update-docker-ci-test
CI: use branch/tag as the Docker tag instead of sha256
2 parents 72fd9e9 + 539e33a commit 1540b5b

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

.github/workflows/docker.yaml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,20 @@ jobs:
215215
- name: Git checkout
216216
uses: actions/checkout@v5
217217

218-
- name: Download frontend digest artifacts
219-
uses: actions/download-artifact@v6
220-
with:
221-
path: /tmp/digests
222-
pattern: frontend-digests-*
223-
merge-multiple: true
218+
- name: Set up environment variables
219+
run: |
220+
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
221+
echo "DOCKER_TAG=develop" >> $GITHUB_ENV
222+
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
223+
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
224+
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
225+
TAG="${GITHUB_REF#refs/tags/}"
226+
echo "DOCKER_TAG=${TAG}" >> $GITHUB_ENV
227+
elif [[ "${{ github.ref }}" == refs/heads/release/* ]]; then
228+
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
229+
VERSION="${BRANCH_NAME#release/}"
230+
echo "DOCKER_TAG=${VERSION}" >> $GITHUB_ENV
231+
fi
224232
225233
- name: Set up Docker Buildx
226234
uses: docker/setup-buildx-action@v3
@@ -231,20 +239,10 @@ jobs:
231239
username: ${{ secrets.DOCKERHUB_USERNAME }}
232240
password: ${{ secrets.DOCKERHUB_TOKEN }}
233241

234-
- name: Get image digest
235-
id: digest
236-
run: |
237-
# Get the first digest from artifacts (we'll test with amd64)
238-
DIGEST=$(ls /tmp/digests | head -1)
239-
echo "digest=sha256:${DIGEST}" >> $GITHUB_OUTPUT
240-
241242
- name: Test frontend image with ${{ matrix.environment }} environment
242243
run: |
243-
# Pull the image by digest
244-
docker pull ${{ env.REGISTRY_FRONTEND_IMAGE }}@${{ steps.digest.outputs.digest }}
245-
246-
# Tag it for easier reference
247-
docker tag ${{ env.REGISTRY_FRONTEND_IMAGE }}@${{ steps.digest.outputs.digest }} test-frontend:${{ matrix.environment }}
244+
# Pull the image by tag
245+
docker pull ${{ env.REGISTRY_FRONTEND_IMAGE }}:${{ env.DOCKER_TAG }}
248246
249247
# Run the test script
250248
./.github/scripts/docker/test-frontend-docker.sh test-frontend:${{ matrix.environment }} ${{ matrix.environment }}

0 commit comments

Comments
 (0)