-
Notifications
You must be signed in to change notification settings - Fork 0
197 lines (176 loc) · 6.67 KB
/
ci-and-cd.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: CI & CD
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
jobs:
build_test_image:
name: Build Test Image
runs-on: ubuntu-latest
outputs:
build-uuid: ${{ steps.uuidgen.outputs.uuid }}
build-runner-uid: ${{ steps.variables.outputs.runner-uid }}
build-runner-user: ${{ steps.variables.outputs.runner-user }}
build-timestamp: ${{ steps.build-timestamp.outputs.timestamp }}
git-branch: ${{ steps.variables.outputs.git-branch }}
git-dasherized-branch: ${{ steps.variables.outputs.git-dasherized-branch }}
git-commit-sha: ${{ steps.variables.outputs.git-commit-sha }}
git-commit-short-sha: ${{ steps.variables.outputs.git-commit-short-sha }}
steps:
- # We'll generate a unique id that we'll use to identify the build run
# on our systems
name: Generate UUID for build
id: uuidgen
run: echo "::set-output name=uuid::$(uuidgen)"
- name: Set additional variables
id: variables
uses: icalia-actions/common-variables@v0.0.3
- name: Set build timestamp
id: build-timestamp
run: echo "::set-output name=timestamp::$(date +%s)"
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build Image
id: build_test_image
uses: docker/build-push-action@v2
with:
target: development
platforms: linux/amd64
builder: ${{ steps.buildx.outputs.name }}
build-args: |
DEVELOPER_UID=${{ steps.variables.outputs.runner-uid }}
DEVELOPER_USERNAME=${{ steps.variables.outputs.runner-user }}
tags: |
icalialabs/icalia-sdk-ruby:testing-${{ steps.variables.outputs.git-dasherized-branch }}
icalialabs/icalia-sdk-ruby:testing-latest
cache-from: type=gha
cache-to: type=gha,mode=max
build_core:
name: Core
uses: IcaliaLabs/icalia-sdk-ruby/.github/workflows/test-and-build-gem.yml@a4019ddc46ac5022241bbd7b03b91d98212ac4db
needs:
- build_test_image
with:
build-runner-uid: ${{ needs.build_test_image.outputs.build-runner-uid }}
build-runner-user: ${{ needs.build_test_image.outputs.build-runner-user }}
service-name-base: core
git-dasherized-branch: ${{ needs.build_test_image.outputs.git-dasherized-branch }}
build_event_notification:
name: Event Notification
uses: IcaliaLabs/icalia-sdk-ruby/.github/workflows/test-and-build-gem.yml@a4019ddc46ac5022241bbd7b03b91d98212ac4db
needs:
- build_test_image
with:
build-runner-uid: ${{ needs.build_test_image.outputs.build-runner-uid }}
build-runner-user: ${{ needs.build_test_image.outputs.build-runner-user }}
service-name-base: event_notification
git-dasherized-branch: ${{ needs.build_test_image.outputs.git-dasherized-branch }}
build_event_webhook:
name: Event Webhook
uses: IcaliaLabs/icalia-sdk-ruby/.github/workflows/test-and-build-gem.yml@a4019ddc46ac5022241bbd7b03b91d98212ac4db
needs:
- build_test_image
with:
build-runner-uid: ${{ needs.build_test_image.outputs.build-runner-uid }}
build-runner-user: ${{ needs.build_test_image.outputs.build-runner-user }}
service-name-base: event_webhook
git-dasherized-branch: ${{ needs.build_test_image.outputs.git-dasherized-branch }}
build_event_meta:
name: Event Meta
uses: IcaliaLabs/icalia-sdk-ruby/.github/workflows/test-and-build-gem.yml@a4019ddc46ac5022241bbd7b03b91d98212ac4db
needs:
- build_test_image
with:
build-runner-uid: ${{ needs.build_test_image.outputs.build-runner-uid }}
build-runner-user: ${{ needs.build_test_image.outputs.build-runner-user }}
service-name-base: event_meta
git-dasherized-branch: ${{ needs.build_test_image.outputs.git-dasherized-branch }}
build_sdk_meta:
name: SDK Meta
uses: IcaliaLabs/icalia-sdk-ruby/.github/workflows/test-and-build-gem.yml@a4019ddc46ac5022241bbd7b03b91d98212ac4db
needs:
- build_test_image
with:
build-runner-uid: ${{ needs.build_test_image.outputs.build-runner-uid }}
build-runner-user: ${{ needs.build_test_image.outputs.build-runner-user }}
service-name-base: sdk_meta
git-dasherized-branch: ${{ needs.build_test_image.outputs.git-dasherized-branch }}
publish_core:
name: Core
if: github.event_name == 'release'
uses: IcaliaLabs/icalia-sdk-ruby/.github/workflows/publish-gem.yml@a4019ddc46ac5022241bbd7b03b91d98212ac4db
needs:
- build_core
- build_event_notification
- build_event_webhook
- build_event_meta
- build_sdk_meta
with:
base-directory: core
secrets:
gem-host-api-key: ${{ secrets.ICALIALABS_GEM_HOST_API_KEY }}
publish_event_notification:
name: Event Notification
if: github.event_name == 'release'
uses: IcaliaLabs/icalia-sdk-ruby/.github/workflows/publish-gem.yml@a4019ddc46ac5022241bbd7b03b91d98212ac4db
needs:
- build_core
- build_event_notification
- build_event_webhook
- build_event_meta
- build_sdk_meta
with:
base-directory: event-notification
secrets:
gem-host-api-key: ${{ secrets.ICALIALABS_GEM_HOST_API_KEY }}
publish_event_webhook:
name: Event Webhook
if: github.event_name == 'release'
uses: IcaliaLabs/icalia-sdk-ruby/.github/workflows/publish-gem.yml@a4019ddc46ac5022241bbd7b03b91d98212ac4db
needs:
- build_core
- build_event_notification
- build_event_webhook
- build_event_meta
- build_sdk_meta
with:
base-directory: event-webhook
secrets:
gem-host-api-key: ${{ secrets.ICALIALABS_GEM_HOST_API_KEY }}
publish_event_meta:
name: Event Meta
if: github.event_name == 'release'
uses: IcaliaLabs/icalia-sdk-ruby/.github/workflows/publish-gem.yml@a4019ddc46ac5022241bbd7b03b91d98212ac4db
needs:
- build_core
- build_event_notification
- build_event_webhook
- build_event_meta
- build_sdk_meta
with:
base-directory: event
secrets:
gem-host-api-key: ${{ secrets.ICALIALABS_GEM_HOST_API_KEY }}
publish_sdk_meta:
name: SDK Meta
if: github.event_name == 'release'
uses: IcaliaLabs/icalia-sdk-ruby/.github/workflows/publish-gem.yml@a4019ddc46ac5022241bbd7b03b91d98212ac4db
needs:
- build_core
- build_event_notification
- build_event_webhook
- build_event_meta
- build_sdk_meta
with:
base-directory: sdk
secrets:
gem-host-api-key: ${{ secrets.ICALIALABS_GEM_HOST_API_KEY }}