Skip to content

Commit

Permalink
ci(grype): Add missing layer cache for grype
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelsJP committed Nov 25, 2024
1 parent e959b88 commit 0c07682
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/vulnerability-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0c07682

Please sign in to comment.