Skip to content

feat: build multiple opcua containers, one per main release #14

feat: build multiple opcua containers, one per main release

feat: build multiple opcua containers, one per main release #14

Workflow file for this run

name: publish
on:
pull_request:
push:
tags:
- "*"
jobs:
# Wait until all other publishing jobs are finished
# before publishing the virtual packages (which are architecture agnostic)
publish-containers:
name: Publish ${{ matrix.target.image }} (${{ matrix.target.opcua_version }})
runs-on: ubuntu-20.04
env:
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
target:
# Keep the "opcua-device-gateway" image on the latest available version
# which should align with the Cumulocity version used on the cloud trial tenants (e.g. eu-latest.cumulocity.com)
- opcua_version: "1020.62.0"
image: opcua-device-gateway
- opcua_version: "1020.62.0"
image: opcua-device-gateway-1020
- opcua_version: "1018.0.308"
image: opcua-device-gateway-1018
- opcua_version: "1017.0.289"
image: opcua-device-gateway-1017
- opcua_version: "1016.0.327"
image: opcua-device-gateway-1016
- opcua_version: "1015.0.455"
image: opcua-device-gateway-1015
- opcua_version: "1014.0.413"
image: opcua-device-gateway-1014
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
- uses: extractions/setup-just@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
name=ghcr.io/thin-edge/${{ matrix.target.image }},enable=true
tags: |
type=raw,value={{tag}}
type=raw,value=latest
- name: Build and push
uses: docker/build-push-action@v5
with:
context: containers/opcua-device-gateway
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
VERSION=${{ matrix.target.opcua_version }}