switch to bsp based naming for images #67
Workflow file for this run
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: true | |
max-parallel: 1 # take advantage of caching | |
matrix: | |
target: [developer, runtime] | |
# add more targets here and add a Dockerfile.${{ matrix.target }} to the repo | |
target_architecture: [beatnik] | |
runs-on: ubuntu-latest | |
env: | |
TAG: ghcr.io/${{ github.repository_owner }}/rtems-${{ matrix.target_architecture }}-${{ matrix.target }} | |
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: | |
file: Dockerfile.${{ matrix.target_architecture }} | |
target: ${{ matrix.target }} | |
tags: ${{ env.TAG }}:${{ github.ref_name }},${{ env.TAG }}:latest | |
cache-from: type=gha,scope=${{ matrix.target }} | |
cache-to: type=gha,mode=max,scope=${{ matrix.target }} | |
load: true | |
- name: Test image | |
run: echo 'no tests yet' | |
- name: Push image | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} | |
uses: docker/build-push-action@v5 | |
with: | |
file: Dockerfile.${{ matrix.target_architecture }} | |
tags: ${{ env.TAG }}:${{ github.ref_name }},${{ env.TAG }}:latest | |
push: true |