-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (61 loc) · 2.02 KB
/
build-docker-images.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
name: Build Docker Images
on:
push:
branches:
- ci
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: "ghcr.io/silitics/rugpi-bakery:latest"
PI_BASE_IMAGE: "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-05-03/2023-05-03-raspios-bullseye-arm64-lite.img.xz"
jobs:
build-docker-images:
name: Build Docker Images
runs-on: ubuntu-latest
strategy:
matrix:
platform: [linux/amd64, linux/arm64]
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile.rugpi-bakery
platforms: ${{ matrix.platform }}
push: true
tags: ${{ env.IMAGE_NAME }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-template-image:
name: Build Image
runs-on: ubuntu-latest
needs: [build-docker-images]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: List Files
working-directory: ./template
run: ls -l
- name: Install QEMU
run: docker run --privileged --rm tonistiigi/binfmt --install arm64
- name: Extract Image
working-directory: ./template
run: ./run-bakery extract ${{ env.PI_BASE_IMAGE }} build/base.tar
- name: Customize System
working-directory: ./template
run: ./run-bakery customize build/base.tar build/customized.tar
- name: Bake Image
working-directory: ./template
run: ./run-bakery bake build/customized.tar build/customized.img