-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (150 loc) · 5.42 KB
/
buildah-build-devel.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
168
name: buildah-build-devel
on:
workflow_dispatch:
schedule:
- cron: "41 19 * * *" # 19:41 UTC everyday
push:
paths:
- .github/workflows/buildah-build-devel.yml # Self-trigger
- containers/autoware-devel/**
env:
REGISTRY: ghcr.io/bounverif
IMAGE_NAME: autoware
AUTOWARE_VERSION: latest
CONTAINERS_ROOT: /home/runner/.local/share/containers
TMPDIR: /home/runner/.local/share/containers/tmp
permissions:
contents: read
packages: write
jobs:
buildah-build-devel:
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 "AUTOWARE_VERSION=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Create VERSION file for the container
run: |
mkdir -p containers/etc/autoware
echo ${{ env.AUTOWARE_VERSION }} > containers/etc/autoware/VERSION
- 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 base container image
id: build-base
uses: redhat-actions/buildah-build@v2
with:
platforms: linux/amd64
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.AUTOWARE_VERSION }}-base latest-base
layers: true
oci: true
build-args: |
AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}
extra-args: |
--target autoware-base
containerfiles: |
containers/autoware-devel/Dockerfile
context: containers
- name: Build builder container image
id: build-builder
uses: redhat-actions/buildah-build@v2
with:
platforms: linux/amd64
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.AUTOWARE_VERSION }}-builder latest-builder
layers: true
oci: true
build-args: |
AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}
extra-args: |
--target autoware-builder
containerfiles: |
containers/autoware-devel/Dockerfile
context: containers
- name: Build builder-with-cache container image
id: build-builder-with-cache
uses: redhat-actions/buildah-build@v2
with:
platforms: linux/amd64
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.AUTOWARE_VERSION }}-builder-with-cache latest-builder-with-cache
layers: true
oci: true
build-args: |
AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}
extra-args: |
--target autoware-builder-with-cache
containerfiles: |
containers/autoware-devel/Dockerfile
context: containers
- name: Build devel container image
id: build-devel
uses: redhat-actions/buildah-build@v2
with:
platforms: linux/amd64
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.AUTOWARE_VERSION }}-devel latest-devel
layers: true
oci: true
build-args: |
AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}
extra-args: |
--target autoware-devel
containerfiles: |
containers/autoware-devel/Dockerfile
context: containers
- name: Push to GitHub Container Repository
if: github.ref == 'refs/heads/main'
id: push-base-ghcr
uses: redhat-actions/push-to-registry@v2
with:
registry: ${{ env.REGISTRY }}
image: ${{ steps.build-base.outputs.image }}
tags: ${{ steps.build-base.outputs.tags }}
- 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 }}
- name: Push to GitHub Container Repository
if: github.ref == 'refs/heads/main'
id: push-builder-with-cache-ghcr
uses: redhat-actions/push-to-registry@v2
with:
registry: ${{ env.REGISTRY }}
image: ${{ steps.build-builder-with-cache.outputs.image }}
tags: ${{ steps.build-builder-with-cache.outputs.tags }}
- name: Push to GitHub Container Repository
if: github.ref == 'refs/heads/main'
id: push-devel-ghcr
uses: redhat-actions/push-to-registry@v2
with:
registry: ${{ env.REGISTRY }}
image: ${{ steps.build-devel.outputs.image }}
tags: ${{ steps.build-devel.outputs.tags }}
test-builder-with-cache:
if: github.ref == 'refs/heads/main'
needs: buildah-build-devel
uses: ./.github/workflows/test-builder-with-cache.yml