Skip to content

Commit 5abc083

Browse files
committed
#369 Use local Docker image with SHA tag
The container image must be there due to a previous build step
1 parent 16edb58 commit 5abc083

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/build-artifacts.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
required: true
77
type: string
88
default: '17'
9+
push-docker-sha:
10+
required: false
11+
type: boolean
12+
default: false
913
run-sonar:
1014
required: false
1115
type: boolean
@@ -57,6 +61,11 @@ jobs:
5761
- name: Execute Gradle build
5862
run: ./gradlew clean check integrationTest build --scan --stacktrace
5963

64+
- name: Push Docker with Git SHA as tag for subsequent tests
65+
if: ${{ inputs.push-docker-sha }}
66+
run: |
67+
./gradlew dockerPush -Pdocker.image.additional.tags=${{ github.sha }}
68+
6069
- name: Cache SonarCloud packages
6170
uses: actions/cache@v4
6271
if: ${{ inputs.run-sonar }}

.github/workflows/gradle-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
# SonarQube requires JDK 17 or higher
2121
java-version: '17'
2222
run-sonar: ${{ github.repository == 'aim42/htmlSanityCheck' }}
23+
push-docker-sha: 'true'
2324
secrets:
2425
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2526

@@ -33,8 +34,7 @@ jobs:
3334

3435
- name: Prepare Docker image for test
3536
run: |
36-
tag="${GITHUB_REF_NAME:=$(git branch --show-current)}"
37-
tag="${tag/\//-}"
37+
tag="${{ github.sha }}"
3838
docker tag "ghcr.io/aim42/hsc:${tag}" ghcr.io/aim42/hsc:v2
3939
4040
- name: Download Artifacts

0 commit comments

Comments
 (0)