Skip to content

Commit

Permalink
Populate trivy cache
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitris Karakasilis <[email protected]>
  • Loading branch information
jimmykarily committed Oct 2, 2024
1 parent 88877f5 commit b2a0ea3
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 7 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/release-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,13 @@ jobs:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Trivy Cache
- name: Restore trivy cache
uses: yogeshlonkar/trivy-cache-action@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Populate trivy Cache
run: |
earthly +trivy-download-db --DIR .trivy
- name: Build 🔧
run: |
earthly -P +all-arm \
Expand Down Expand Up @@ -364,10 +367,13 @@ jobs:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Trivy Cache
- name: Restore trivy cache
uses: yogeshlonkar/trivy-cache-action@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Populate trivy Cache
run: |
earthly +trivy-download-db --DIR .trivy
- name: Build 🔧
run: |
earthly -P +all-arm \
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,13 @@ jobs:
with:
repository: quay.io/kairos/packages
packages: utils/earthly
- name: Trivy Cache
- name: Restore trivy cache
uses: yogeshlonkar/trivy-cache-action@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Populate trivy Cache
run: |
earthly +trivy-download-db --DIR .trivy
- name: Build 🔧
run: |
earthly +all \
Expand Down Expand Up @@ -412,10 +415,13 @@ jobs:
packages: utils/earthly
- name: Login to Quay Registry
run: echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USERNAME }} --password-stdin quay.io
- name: Trivy Cache
- name: Restore trivy cache
uses: yogeshlonkar/trivy-cache-action@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Populate trivy Cache
run: |
earthly +trivy-download-db --DIR .trivy
- name: Build 🔧
run: |
earthly +all \
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/reusable-build-flavor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ jobs:
- name: Login to earthly
run: |
earthly account login --token ${{ secrets.EARTHLY_TOKEN }} && earthly org select Kairos
- name: Trivy Cache
- name: Restore trivy cache
uses: yogeshlonkar/trivy-cache-action@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Populate trivy Cache
run: |
earthly +trivy-download-db --DIR .trivy
- name: Build PR 🔧
if: ${{ github.event_name == 'pull_request' }}
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/reusable-build-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ jobs:
- name: Login to earthly
run: |
earthly account login --token ${{ secrets.EARTHLY_TOKEN }} && earthly org select Kairos
- name: Trivy Cache
- name: Restore trivy cache
uses: yogeshlonkar/trivy-cache-action@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Populate trivy Cache
run: |
earthly +trivy-download-db --DIR .trivy
- name: Build PR 🔧
if: ${{ github.event_name == 'pull_request' }}
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/reusable-docker-arm-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ jobs:
- name: Login to earthly
run: |
earthly account login --token ${{ secrets.EARTHLY_TOKEN }} && earthly org select Kairos
- name: Trivy Cache
- name: Restore trivy cache
uses: yogeshlonkar/trivy-cache-action@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Populate trivy Cache
run: |
earthly +trivy-download-db --DIR .trivy
- name: Build 🔧
run: |
earthly -P +all-arm \
Expand Down
1 change: 1 addition & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ trivy-download-db:
ARG DIR=trivy-cache
FROM aquasec/trivy:$TRIVY_VERSION

COPY $DIR /trivy-cache

Check failure on line 775 in Earthfile

View workflow job for this annotation

GitHub Actions / alpine / build

Error

The command COPY .trivy /trivy-cache failed: "/.trivy": not found

Check failure on line 775 in Earthfile

View workflow job for this annotation

GitHub Actions / opensuse / build

Error

The command COPY .trivy /trivy-cache failed: "/.trivy": not found

Check failure on line 775 in Earthfile

View workflow job for this annotation

GitHub Actions / core-alpine / build

Error

The command COPY .trivy /trivy-cache failed: "/.trivy": not found

Check failure on line 775 in Earthfile

View workflow job for this annotation

GitHub Actions / core-ubuntu-22-lts / build

Error

The command COPY .trivy /trivy-cache failed: "/.trivy": not found

Check failure on line 775 in Earthfile

View workflow job for this annotation

GitHub Actions / core-ubuntu-24-lts / build

Error

The command COPY .trivy /trivy-cache failed: "/.trivy": not found

Check failure on line 775 in Earthfile

View workflow job for this annotation

GitHub Actions / standard / build

Error

The command COPY .trivy /trivy-cache failed: "/.trivy": not found
RUN /usr/local/bin/trivy --cache-dir /trivy-cache fs --download-db-only
SAVE ARTIFACT /trivy-cache AS LOCAL $DIR

Expand Down

0 comments on commit b2a0ea3

Please sign in to comment.