-
Notifications
You must be signed in to change notification settings - Fork 147
73 lines (64 loc) · 2.14 KB
/
build-opcua-monitoring-broker-container.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
name: Build OPC UA Monitoring Broker
on:
push:
branches: [ main ]
paths:
- .github/workflows/build-opcua-monitoring-broker-container.yml
- build/containers/Dockerfile.opcua-monitoring-broker
- samples/brokers/opcua-monitoring-broker/**
- version.txt
pull_request:
branches: [ main ]
paths:
- .github/workflows/build-opcua-monitoring-broker-container.yml
- build/containers/Dockerfile.opcua-monitoring-broker
- samples/brokers/opcua-monitoring-broker/**
- version.txt
release:
types:
- published
jobs:
build-broker:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout the head commit of the branch
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Get version.txt
id: version-string
run: |
echo "version=$(cat version.txt)" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up 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
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/project-akri/akri/opcua-monitoring-broker
labels: |
org.opencontainers.image.title=akri-opcua-monitoring-broker
org.opencontainers.image.description=Akri sample opcua monitoring broker
tags: |
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=${{steps.version-string.outputs.version}},enable=${{github.event_name != 'release'}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: build/containers/Dockerfile.opcua-monitoring-broker
platforms: linux/amd64,linux/arm64,linux/arm/v7