-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.27 KB
/
clair-db.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Generate Clair Database
on:
schedule:
# Every 12 hours (at 11:00 and 23:00)
- cron: '0 11,23 * * *'
workflow_dispatch:
pull_request:
env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
jobs:
generate:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
env:
IMAGE_NAME: eternal-linux/helpers/ci/clair-db
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run Clair V4 update
uses: quay/clair-action@allow-update
with:
db-file: .clair/matcher.db
mode: update
- name: Compress database
run: |
tar -czvf .clair/matcher.db.tar.gz .clair/matcher.db
rm .clair/matcher.db
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: .clair/.
file: .clair/Containerfile
push: true
tags: |
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest