-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (48 loc) · 1.49 KB
/
build_alpine_images.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
name: Build Alpine images
on:
workflow_dispatch:
push:
branches: [main]
schedule:
- cron: '0 5 * * 1'
jobs:
build:
name: Build
strategy:
matrix:
include:
- stunnel_version: 5.71-r0
alpine_version: 3.18.3
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Force build if workflow_dispatch or re-run
id: force
if: github.event_name == 'workflow_dispatch' || github.run_attempt != '1'
run: echo "FORCE=1" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build GHCR tag (if needed)
working-directory: alpine
env:
IMAGE_NAME_ROOT: ghcr.io/${{ github.repository_owner }}/
STUNNEL_VERSION: ${{ matrix.stunnel_version }}
ALPINE_VERSION: ${{ matrix.alpine_version }}
run: bash build_container.sh
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ghcr.io/${{ github.repository_owner }}/stunnel:${{ matrix.stunnel_version }}-alpine-${{ matrix.alpine_version }}
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'