-
Notifications
You must be signed in to change notification settings - Fork 4
94 lines (83 loc) · 3.14 KB
/
build.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
name: Build and publish image to ghcr.io/epics-containers
on:
push:
pull_request:
jobs:
build:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
epics-target: [RTEMS-beatnik, linux-x86_64, linux-aarch64]
include:
- os: ubuntu-latest # everyone is on os-latest
# native linux compile
- epics-target: linux-x86_64
epics-host: linux-x86_64
name: epics-base
base_image: ubuntu:22.04
platform: linux/amd64
# cross compile for RTEMS to VME5500 (power pc beatnik)
- epics-target: RTEMS-beatnik
epics-host: linux-x86_64
name: epics-base-rtems-beatnik
base_image: ghcr.io/epics-containers/rtems-beatnik-runtime:6.1rc2
platform: linux/amd64
# cross compile to arm64
- epics-target: linux-aarch64
epics-host: linux-x86_64
name: epics-base-aarch64
base_image: ubuntu:22.04
platform: linux/amd64
runs-on: ${{ matrix.os }}
env:
TAG: ghcr.io/${{ github.repository_owner }}/${{ matrix.name }}
steps:
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v5
with:
platforms: ${{ matrix.platform }}
target: runtime
build-args: |
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
BASE_IMAGE=${{ matrix.base_image }}
cache-from: type=gha,scope=${{ matrix.epics-target }}
cache-to: type=gha,mode=max,scope=${{ matrix.epics-target }}
load: true
- name: Push developer image
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: docker/build-push-action@v5
with:
platforms: ${{ matrix.platform }}
target: developer
build-args: |
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
BASE_IMAGE=${{ matrix.base_image }}
tags: ${{ env.TAG }}-developer:${{ github.ref_name }}
push: true
- name: Push runtime image
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: docker/build-push-action@v5
with:
platforms: ${{ matrix.platform }}
target: runtime
build-args: |
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
BASE_IMAGE=${{ matrix.base_image }}
tags: ${{ env.TAG }}-runtime:${{ github.ref_name }}
push: true