-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (55 loc) · 1.69 KB
/
build_docker_image.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
name: Build Docker Images
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
env:
REGISTRY: ghcr.io
jobs:
build:
name: build ((${{ matrix.platform.docker_platform}})
runs-on: ubuntu-latest
strategy:
matrix:
version: ["2_28"]
platform:
- arch: "x86_64"
runner_arch: "X64"
docker_platform: "linux/amd64"
- arch: 'aarch64'
runner_arch: "ARM64"
docker_platform: "linux/arm64"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
if: ${{ env.RUNNER_ARCH }} != ${{ matrix.platform.runner_arch }}
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to the container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/manylinux_${{ matrix.version }}_conda_epics
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform.docker_platform }}
push: ${{ github.event_name != 'pull_request' }}
build-args: |
VER=${{ matrix.version }}
ARCH=${{ matrix.platform.arch }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}