-
Notifications
You must be signed in to change notification settings - Fork 1
167 lines (137 loc) · 3.44 KB
/
build-image.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Docker Image CI
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '37 1 * * 6'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache dive
uses: actions/cache@v4
with:
key : dive
path: |
dive_linux_*
- name: Cache skopeo
uses: actions/cache@v4
with:
key : skopeo
path: |
skopeo_*
- name: list dive
run : |
arch=$(uname -m) && if [ "$arch" == "aarch64" ]; then cp dive_linux_arm64 dive; elif [ "$arch" == "x86_64" ]; then cp dive_linux_amd64 dive; fi
- name: list skopeo
run : |
arch=$(uname -m) && if [ "$arch" == "aarch64" ]; then cp skopeo_arm64 skopeo; elif [ "$arch" == "x86_64" ]; then cp skopeo_amd64 skopeo; fi
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v3
name: Build and push
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: nmaguiar/imgutils:build
# - uses: docker/build-push-action@v3
# name: Build and push ubi
# with:
# platforms: linux/amd64,linux/arm64
# file: Dockerfile.ubi
# push: true
# tags: nmaguiar/imgutils:ubi-build
test-skopeo:
name : test skopeo
runs-on: ubuntu-latest
needs : build
steps :
- uses: actions/checkout@v4
- name: Test skopeo inspect
uses: ./
with:
cmd: sudo skopeo inspect docker://nmaguiar/imgutils:build > /dev/null
test-helm:
name : test helm
runs-on: ubuntu-latest
needs : build
steps:
- uses: actions/checkout@v4
- name: Test helm
uses: ./
with:
cmd: sudo helm repo add bitnami https://charts.bitnami.com/bitnami && sudo helm pull bitnami/nginx
test-docker:
name : test docker
runs-on: ubuntu-latest
needs : build
steps:
- uses: actions/checkout@v4
- name: Test docker
uses: ./
with:
cmd: docker run --rm nmaguiar/imgutils:build id
test-crictl:
name : test crictl
runs-on: ubuntu-latest
needs : build
steps:
- uses: actions/checkout@v4
- name: Test crictl
uses: ./
with:
cmd: crictl -v
test-ctr:
name : test ctr
runs-on: ubuntu-latest
needs : build
steps:
- uses: actions/checkout@v4
- name: Test ctr
uses: ./
with:
cmd: ctr -v
test-nerdctl:
name : test nerdctl
runs-on: ubuntu-latest
needs : build
steps:
- uses: actions/checkout@v4
- name: Test nerdctl
uses: ./
with:
cmd: nerdctl -v
test-openaf:
name : test openaf
runs-on: ubuntu-latest
needs : build
steps:
- uses: actions/checkout@v4
- name: Test openaf
uses: ./
with:
cmd: oaf -v
test-syft:
name : test syft
runs-on: ubuntu-latest
needs : build
steps:
- uses: actions/checkout@v4
- name: Test syft
uses: ./
with:
cmd: sudo syft scan nmaguiar/imgutils -o syft-table > /dev/null