-
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (66 loc) · 2.82 KB
/
docker-push.yml
File metadata and controls
76 lines (66 loc) · 2.82 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build & Push Docker Images to GHCR
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Save lowercase owner and repository names
id: save-vars
run: |
echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Update apt packages and install qemu
run: |
sudo apt update -y && sudo apt upgrade -y
sudo apt install -y make ninja-build libpixman-1-dev libglib2.0-dev
git clone https://gitlab.com/qemu-project/qemu.git
cd qemu
./configure \
--target-list=aarch64-linux-user \
--static \
--enable-linux-user \
--disable-system \
--disable-tools \
--disable-docs \
--prefix=/opt/qemu-arm64
make -j$(nproc)
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes
cd ..
rm -rf ./qemu
- name: Copy .dockerignore file
run: |
for dir in firmware/*/; do
cp .dockerignore "$dir"
done
- name: Build and push Docker image for Raspberry Pi
run: |
cd firmware/raspberrypi
docker buildx build --pull --platform linux/arm64 --build-context root=../../ --build-context display=../../assets/display \
-f Dockerfile.raspberrypi \
-t ghcr.io/${{ steps.save-vars.outputs.repository }}/raspberrypi:latest \
-t ghcr.io/${{ steps.save-vars.outputs.repository }}/raspberrypi:${{ github.ref_name }} .
docker push ghcr.io/${{ steps.save-vars.outputs.repository }}/raspberrypi:latest
docker push ghcr.io/${{ steps.save-vars.outputs.repository }}/raspberrypi:${{ github.ref_name }}
- name: Build and push Docker image for Jetson Linux
run: |
cd firmware/jetson
docker buildx build --pull --platform linux/arm64 --build-context root=../../ --build-context models=../../assets/trained_models \
-f Dockerfile.jetson \
-t ghcr.io/${{ steps.save-vars.outputs.repository }}/jetson:latest \
-t ghcr.io/${{ steps.save-vars.outputs.repository }}/jetson:${{ github.ref_name }} .
docker push ghcr.io/${{ steps.save-vars.outputs.repository }}/jetson:latest
docker push ghcr.io/${{ steps.save-vars.outputs.repository }}/jetson:${{ github.ref_name }}