-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(grype): Add missing layer cache for grype
- Loading branch information
1 parent
e959b88
commit 0c07682
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,30 @@ jobs: | |
id: buildx | ||
with: | ||
install: true | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Cache Maven packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Prepare the maven cache dependencies | ||
run: | | ||
echo "Sync the maven dependencies" | ||
mvn package -Dmaven.test.skip=true -B dependency:go-offline dependency:resolve-plugins dependency:resolve -q | ||
# Replace all RUN mvn with RUN --mount=type=cache,target=/root/.m2 mvn | ||
sed -i 's/RUN mvn /RUN --mount=type=cache,target=\/root\/.m2 mvn /g' Dockerfile | ||
- name: inject maven-build-cache into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-map: | | ||
{ | ||
"/home/runner/.m2": "/root/.m2" | ||
} | ||
- name: Build image for ${{ matrix.platform }} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
|