remove redundant whitespace #157
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |