-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (98 loc) · 3.47 KB
/
example-containers.yaml
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
name: Create and publish example software containers
on:
push:
branches:
- main
paths:
- "examples/fake-file-process/**"
tags:
- "*"
pull_request:
paths:
- "examples/fake-file-process/**"
env:
REGISTRY: ghcr.io
PRE_PROCESS_IMAGE_NAME: datacloud-project/example-pre-process
PROCESS_IMAGE_NAME: datacloud-project/example-process
ANALYSE_IMAGE_NAME: datacloud-project/example-analyse
FAIL_IMAGE_NAME: datacloud-project/example-fail
jobs:
build-and-push-example-containers:
name: Build and push example containers
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for pre process image
id: meta-pre-process
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.PRE_PROCESS_IMAGE_NAME }}
tags: |
type=raw,value=latest
- name: Build and push Docker pre process image
uses: docker/build-push-action@v4
with:
context: ./examples/fake-file-process/pre-process/
push: true
tags: ${{ steps.meta-pre-process.outputs.tags }}
labels: ${{ steps.meta-pre-process.outputs.labels }}
platforms: linux/arm64,linux/amd64
- name: Extract metadata (tags, labels) for process image
id: meta-process
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.PROCESS_IMAGE_NAME }}
tags: |
type=raw,value=latest
- name: Build and push Docker process image
uses: docker/build-push-action@v4
with:
context: ./examples/fake-file-process/process/
push: true
tags: ${{ steps.meta-process.outputs.tags }}
labels: ${{ steps.meta-process.outputs.labels }}
platforms: linux/arm64,linux/amd64
- name: Extract metadata (tags, labels) for analyse image
id: meta-analyse
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.ANALYSE_IMAGE_NAME }}
tags: |
type=raw,value=latest
- name: Build and push Docker analyse image
uses: docker/build-push-action@v4
with:
context: ./examples/fake-file-process/analyse/
push: true
tags: ${{ steps.meta-analyse.outputs.tags }}
labels: ${{ steps.meta-analyse.outputs.labels }}
platforms: linux/arm64,linux/amd64
- name: Extract metadata (tags, labels) for fail image
id: meta-fail
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.FAIL_IMAGE_NAME }}
tags: |
type=raw,value=latest
- name: Build and push Docker fail image
uses: docker/build-push-action@v4
with:
context: ./examples/fake-file-process/fail/
push: true
tags: ${{ steps.meta-fail.outputs.tags }}
labels: ${{ steps.meta-fail.outputs.labels }}
platforms: linux/arm64,linux/amd64