-
Notifications
You must be signed in to change notification settings - Fork 4
116 lines (105 loc) · 4.63 KB
/
CI.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Main Branch CI
on:
push:
branches:
- main
- feature/workflowEngine
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
Build-Code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore iotedge/Distributed.IoT.Edge
- name: Build
run: dotnet build iotedge/Distributed.IoT.Edge --no-restore
- name: Test
run: dotnet test iotedge/Distributed.IoT.Edge --no-build --verbosity normal
- name: Build Dockerfile for OpcUa.Publisher module
id: dockerfileOpcUaPublisher
shell: pwsh
run: |
$definition = & ./deployment/build-opcuapublisher-dockerfile.ps1 -Path ./lib/Industrial-IoT/modules/src/Microsoft.Azure.IIoT.Modules.OpcUa.Publisher/src
$dockerfile = $definition.dockerfile
$contentPath = (Join-Path $definition.buildContext /.)
echo "DOCKERFILE=$dockerfile" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "CONTENTPATH=$contentPath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for DataGatewayModule Docker
id: dataGatewayMeta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/bindsi/distributed-az-iot-edge/datagatewaymodule
tags: |
type=raw,value=latest,priority=1000
type=raw,value={{branch}}-{{sha}},priority=200
- name: Build and push DataGatewayModule Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: iotedge/Distributed.IoT.Edge/.
file: iotedge/Distributed.IoT.Edge/Distributed.IoT.Edge.DataGatewayModule/Dockerfile
push: true
tags: ${{ steps.dataGatewayMeta.outputs.tags }}
labels: ${{ steps.dataGatewayMeta.outputs.labels }}
- name: Extract metadata (tags, labels) for WorkflowModule Docker
id: workflowMeta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/bindsi/distributed-az-iot-edge/workflowmodule
tags: |
type=raw,value=latest,priority=1000
type=raw,value={{branch}}-{{sha}},priority=200
- name: Build and push WorkflowModule Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: iotedge/Distributed.IoT.Edge/.
file: iotedge/Distributed.IoT.Edge/Distributed.IoT.Edge.WorkflowModule/Dockerfile
push: true
tags: ${{ steps.workflowMeta.outputs.tags }}
labels: ${{ steps.workflowMeta.outputs.labels }}
- name: Extract metadata (tags, labels) for SimulatedTemperatureSensorModule Docker
id: tempSensorMeta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/bindsi/distributed-az-iot-edge/simulatedtemperaturesensormodule
tags: |
type=raw,value={{branch}}-{{sha}},priority=200
type=raw,value=latest,priority=1000
- name: Build and push SimulatedTemperatureSensorModule Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: iotedge/Distributed.IoT.Edge/.
file: iotedge/Distributed.IoT.Edge/Distributed.IoT.Edge.SimulatedTemperatureSensorModule/Dockerfile
push: true
tags: ${{ steps.tempSensorMeta.outputs.tags }}
labels: ${{ steps.tempSensorMeta.outputs.labels }}
- name: Extract metadata (tags, labels) for OpcUa.Publisher Docker
id: opcUaPublisher
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/bindsi/distributed-az-iot-edge/opcuapublisher
tags: |
type=raw,value={{branch}}-{{sha}},priority=200
type=raw,value=latest,priority=1000
- name: Build and push OpcUa.Publisher Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ${{ env.CONTENTPATH }}
file: ${{ env.DOCKERFILE }}
push: true
tags: ${{ steps.opcUaPublisher.outputs.tags }}
labels: ${{ steps.opcUaPublisher.outputs.labels }}