-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (71 loc) · 2.64 KB
/
test_update_linux_amd64.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build and test oc.user images linux/amd64, linux/arm64
on:
push:
env:
imagetag: ${{ github.head_ref || github.ref_name || 'dev' }}
jobs:
build_matrix:
strategy:
matrix:
target_mode: [default, hardening]
# The type of runner that the job will run on
# runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Run Buildx oc.user
run: |
./mkversion.sh ${{ matrix.target_mode }}
- name: Build test image abcdesktopio/oc.user:test.${{ env.imagetag }}
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.ubuntu
platforms: linux/amd64
push: true
build-args: |
TARGET_MODE=${{ matrix.target_mode }}
ABCDESKTOP_LOCALACCOUNT_DIR=/etc/localaccount
TAG=22.04
BASE_IMAGE_RELEASE=22.04
BASE_IMAGE=ubuntu
tags: abcdesktopio/oc.user.${{ matrix.target_mode }}:test.${{ env.imagetag }}
- name: Run and test docker image abcdesktopio/oc.user.${{ matrix.target_mode }}:test.${{ env.imagetag }}
run: |
TARGET_MODE=${{ matrix.target_mode }} ./make-test.sh abcdesktopio/oc.user.${{ matrix.target_mode }}:test.${{ env.imagetag }}
- name: Build and push image oc.user.${{ matrix.target_mode }}:${{ env.imagetag }}
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.ubuntu
platforms: linux/amd64, linux/arm64
push: true
build-args: |
TARGET_MODE=${{ matrix.target_mode }}
ABCDESKTOP_LOCALACCOUNT_DIR=/etc/localaccount
TAG=22.04
BASE_IMAGE_RELEASE=22.04
BASE_IMAGE=ubuntu
tags: abcdesktopio/oc.user.${{ matrix.target_mode }}:${{ env.imagetag }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: abcdesktopio/oc.user.${{ matrix.target_mode }}:${{ env.imagetag }}
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'