-
Notifications
You must be signed in to change notification settings - Fork 13
68 lines (59 loc) · 1.61 KB
/
build-docker.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
name: Build manylinux docker container
on:
push:
tags:
- '*'
branches:
- develop
- ci/*
paths:
- Dockerfile
pull_request:
types:
- opened
- synchronize
branches:
- develop
paths:
- Dockerfile
env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Prepare
run: |
if [ "${{ matrix.platform }}" = "linux/amd64" ]; then
echo "TARGET_ARCH=x86_64" >> $GITHUB_ENV
elif [ "${{ matrix.platform }}" = "linux/arm64" ]; then
echo "TARGET_ARCH=aarch64" >> $GITHUB_ENV
fi
- name: Checkout
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
id: docker_build
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
push: ${{ github.ref == 'refs/heads/develop' }}
platforms: ${{ matrix.platform }}
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/resiliparse-manylinux_2_28_${{ env.TARGET_ARCH }}:latest
build-args: |
TARGET_ARCH=${{ env.TARGET_ARCH }}