Skip to content

adopt generic iocs container build CI #10

adopt generic iocs container build CI

adopt generic iocs container build CI #10

Workflow file for this run

name: Build and publish image to ghcr.io
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
runs-on: ubuntu-latest
outputs:
developer-tag: ${{ steps.meta-developer.outputs.tags }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- 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:
context: ./docker
platforms: ${{ matrix.platform }}
build-args: |
IMAGE_EXT=${{ matrix.extension }}
cache-from: type=gha,scope=${{ matrix.epics-target }}
cache-to: type=gha,mode=max,scope=${{ matrix.epics-target }}
tags: ci_test
load: true
- name: Developer target metadata
id: meta-developer
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
tags: |
type=raw,value=${{ github.ref_name }}
- name: Push developer image
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: docker/build-push-action@v5
with:
context: ./docker
platforms: ${{ matrix.platform }}
build-args: |
IMAGE_EXT=${{ matrix.extension }}
tags: ${{ steps.meta-developer.outputs.tags }}
labels: ${{ steps.meta-developer.outputs.labels }}
push: true
release:
# Release on tag push - publish ioc schema
needs: [build]
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
runs-on: ubuntu-latest
steps:
- name: report container tag name
run: |
echo developer container image tag is ${{ needs.build.outputs.developer-tag }}
- name: Github Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: |
ibek.ioc.schema.json
generate_release_notes: true