Skip to content

Commit 67d7c6a

Browse files
committed
#369 Only pull Container image if necessary
The container image usually should be there due to previous build step
1 parent 55c0b30 commit 67d7c6a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/gradle-build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ jobs:
3333

3434
- name: Prepare Docker image for test
3535
run: |
36-
tag=$(git branch --show-current | tr '/' '-')
37-
docker pull ghcr.io/aim42/hsc:${tag}
38-
docker tag ghcr.io/aim42/hsc:${tag} ghcr.io/aim42/hsc:v2
36+
tag="${GITHUB_REF_NAME:=$(git branch --show-current)}"
37+
tag="${tag/\//-}"
38+
(docker images | egrep -q "ghcr.io/aim42/hsc\\s+${tag}\\s+") || docker pull "ghcr.io/aim42/hsc:${tag}"
39+
docker tag "ghcr.io/aim42/hsc:${tag}" ghcr.io/aim42/hsc:v2
3940
4041
- name: Download Artifacts
4142
uses: actions/download-artifact@v5

0 commit comments

Comments
 (0)