-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (71 loc) · 2.54 KB
/
buildah-build-builder.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
name: buildah-build-builder
on:
workflow_dispatch:
schedule:
- cron: "19 19 * * 0" # 19:19 UTC every Sunday
push:
paths:
- .github/workflows/buildah-build-builder.yml # Self-trigger
- containers/esmini-builder/Dockerfile
env:
REGISTRY: ghcr.io/bounverif
IMAGE_NAME: esmini
ESMINI_VERSION: latest
CONTAINERS_ROOT: /home/runner/.local/share/containers
TMPDIR: /home/runner/.local/share/containers/tmp
permissions:
contents: read
packages: write
jobs:
buildah-build-builder:
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 2048 # Reserve disk space for repository
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
remove-docker-images: "true"
build-mount-path: ${{ env.CONTAINERS_ROOT }} # The remaining space only for container build
- run: mkdir -p $TMPDIR
- name: Checkout repository
uses: actions/checkout@v4
- name: Set current date as the version
run: echo "ESMINI_VERSION=$(curl -sL "https://api.github.com/repos/esmini/esmini/releases/latest" | jq -r '.tag_name')" >> $GITHUB_ENV
- name: Log in to the GitHub Container registry
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build builder container image
id: build-builder
uses: redhat-actions/buildah-build@v2
with:
platforms: linux/amd64
context: ./containers
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.ESMINI_VERSION }}-builder latest-builder
layers: true
oci: true
build-args: |
ESMINI_IMAGE_NAME=${{env.REGISTRY}}}/${{ env.IMAGE_NAME }}
ESMINI_VERSION=${{ env.ESMINI_VERSION }}
extra-args: |
--target esmini-builder
containerfiles: |
./containers/esmini-builder/Dockerfile
- name: Push to GitHub Container Repository
if: github.ref == 'refs/heads/main'
id: push-builder-ghcr
uses: redhat-actions/push-to-registry@v2
with:
registry: ${{ env.REGISTRY }}
image: ${{ steps.build-builder.outputs.image }}
tags: ${{ steps.build-builder.outputs.tags }}