-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.21 KB
/
build-mock-runner.yml
File metadata and controls
52 lines (45 loc) · 1.21 KB
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
name: Build Mock Runner Image
on:
push:
branches: [main]
paths:
- 'mock/Containerfile'
- 'mock/centos-stream-10-ci.cfg'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE: ghcr.io/tuna-os/mock-runner
TAG: centos-stream-10
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to GHCR
run: |
echo "${{ secrets.GITHUB_TOKEN }}" \
| podman login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Build image
run: |
podman build \
--privileged \
--pull=always \
-f mock/Containerfile \
-t "${IMAGE}:${TAG}" \
-t "${IMAGE}:${TAG}-${{ github.sha }}" \
mock/
- name: Push image
run: |
podman push "${IMAGE}:${TAG}"
podman push "${IMAGE}:${TAG}-${{ github.sha }}"
- name: Inspect
run: podman inspect "${IMAGE}:${TAG}" | python3 -c "
import json, sys
data = json.load(sys.stdin)[0]
print('Size: ', round(data['Size'] / 1024**2, 1), 'MiB')
print('Layers:', len(data['RootFS']['Layers']))
"