-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.57 KB
/
build.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
name: Build fresh image
on:
push:
schedule:
- cron: "42 03 * * *"
jobs:
buildandpush:
runs-on: ubuntu-latest
permissions:
packages: write
name: Build images and push to registry
steps:
- name: Checkout repo
uses: actions/checkout@v4
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# https://github.com/docker/login-action#docker-hub
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build latest and push to registry
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64
push: true
tags: ghcr.io/deltablot/php-prod:8.3, ghcr.io/deltablot/php-prod:latest, ghcr.io/deltablot/php-prod:8
# VULN SCAN
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: deltablot/php-prod:latest
format: 'table'
# uncomment to ignore: exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL'