1
1
---
2
2
name : Build Airflow
3
+ run-name : |
4
+ Build Airflow (attempt #${{ github.run_attempt }})
3
5
4
6
env :
5
7
PRODUCT_NAME : airflow
8
+ SDP_VERSION : ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}
6
9
7
10
on :
8
11
workflow_dispatch :
9
12
schedule :
10
- - cron : ' 0 1 1/2 * *' # https://crontab.guru/#0_1_1 /2_*_*
13
+ - cron : ' 0 0 1/2 * *' # https://crontab.guru/#0_0_1 /2_*_*
11
14
push :
12
- branches :
13
- - main
15
+ branches : [main]
16
+ tags : ['*']
14
17
paths :
15
18
# To check dependencies, run this ( you will need to consider transitive dependencies)
16
19
# bake --product PRODUCT -d | grep -v 'docker buildx bake' | jq '.target | keys[]'
17
20
- airflow/**
18
21
- vector/**
19
22
- stackable-base/**
20
23
- .github/actions/**
21
- - .github/workflows/dev_airflow .yaml
24
+ - .github/workflows/build_airflow .yaml
22
25
23
26
jobs :
24
27
generate_matrix :
25
28
name : Generate Version List
26
29
runs-on : ubuntu-latest
27
30
steps :
28
31
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
32
+ with :
33
+ persist-credentials : false
29
34
- id : shard
30
- uses : stackabletech/actions/shard@0c5dbc42a80519b5e1ad6ac1d8bc54a0e1ece8fb # 0.0.7
35
+ uses : stackabletech/actions/shard@a3f7587879e9f12e04a29fd26435949aaa4fd59c # 0.2.0
31
36
with :
32
37
product-name : ${{ env.PRODUCT_NAME }}
33
38
outputs :
40
45
id-token : write
41
46
runs-on : ${{ matrix.runner.name }}
42
47
strategy :
48
+ fail-fast : false
43
49
matrix :
44
50
runner :
45
51
- {name: "ubuntu-latest", arch: "amd64"}
@@ -48,17 +54,23 @@ jobs:
48
54
steps :
49
55
- name : Checkout Repository
50
56
uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
57
+ with :
58
+ persist-credentials : false
59
+
60
+ - name : Free Disk Space
61
+ uses : stackabletech/actions/free-disk-space@a3f7587879e9f12e04a29fd26435949aaa4fd59c # 0.2.0
51
62
52
63
- name : Build Product Image
53
64
id : build
54
- uses : stackabletech/actions/build-product-image@0c5dbc42a80519b5e1ad6ac1d8bc54a0e1ece8fb # 0.0.7
65
+ uses : stackabletech/actions/build-product-image@a3f7587879e9f12e04a29fd26435949aaa4fd59c # 0.2.0
55
66
with :
56
67
product-name : ${{ env.PRODUCT_NAME }}
57
68
product-version : ${{ matrix.versions }}
58
69
build-cache-password : ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }}
70
+ sdp-version : ${{ env.SDP_VERSION }}
59
71
60
72
- name : Publish Container Image on docker.stackable.tech
61
- uses : stackabletech/actions/publish-image@0c5dbc42a80519b5e1ad6ac1d8bc54a0e1ece8fb # 0.0.7
73
+ uses : stackabletech/actions/publish-image@a3f7587879e9f12e04a29fd26435949aaa4fd59c # 0.2.0
62
74
with :
63
75
image-registry-uri : docker.stackable.tech
64
76
image-registry-username : github
68
80
source-image-uri : localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }}
69
81
70
82
- name : Publish Container Image on oci.stackable.tech
71
- uses : stackabletech/actions/publish-image@0c5dbc42a80519b5e1ad6ac1d8bc54a0e1ece8fb # 0.0.7
83
+ uses : stackabletech/actions/publish-image@a3f7587879e9f12e04a29fd26435949aaa4fd59c # 0.2.0
72
84
with :
73
85
image-registry-uri : oci.stackable.tech
74
86
image-registry-username : robot$sdp+github-action-build
@@ -84,26 +96,75 @@ jobs:
84
96
id-token : write
85
97
runs-on : ubuntu-latest
86
98
strategy :
99
+ fail-fast : false
87
100
matrix :
88
101
versions : ${{ fromJson(needs.generate_matrix.outputs.versions) }}
89
102
steps :
90
103
- name : Checkout Repository
91
104
uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
105
+ with :
106
+ persist-credentials : false
92
107
93
108
- name : Publish and Sign Image Index Manifest to docker.stackable.tech
94
- uses : stackabletech/actions/publish-index-manifest@0c5dbc42a80519b5e1ad6ac1d8bc54a0e1ece8fb # 0.0.7
109
+ uses : stackabletech/actions/publish-index-manifest@a3f7587879e9f12e04a29fd26435949aaa4fd59c # 0.2.0
95
110
with :
96
111
image-registry-uri : docker.stackable.tech
97
112
image-registry-username : github
98
113
image-registry-password : ${{ secrets.NEXUS_PASSWORD }}
99
114
image-repository : stackable/${{ env.PRODUCT_NAME }}
100
- image-index-manifest-tag : ${{ matrix.versions }}-stackable0.0.0-dev
115
+ image-index-manifest-tag : ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }}
101
116
102
117
- name : Publish and Sign Image Index Manifest to oci.stackable.tech
103
- uses : stackabletech/actions/publish-index-manifest@0c5dbc42a80519b5e1ad6ac1d8bc54a0e1ece8fb # 0.0.7
118
+ uses : stackabletech/actions/publish-index-manifest@a3f7587879e9f12e04a29fd26435949aaa4fd59c # 0.2.0
104
119
with :
105
120
image-registry-uri : oci.stackable.tech
106
121
image-registry-username : robot$sdp+github-action-build
107
122
image-registry-password : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
108
123
image-repository : sdp/${{ env.PRODUCT_NAME }}
109
- image-index-manifest-tag : ${{ matrix.versions }}-stackable0.0.0-dev
124
+ image-index-manifest-tag : ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }}
125
+
126
+ notify :
127
+ name : Failure Notification
128
+ needs : [generate_matrix, build, publish_manifests]
129
+ runs-on : ubuntu-latest
130
+ if : failure()
131
+ steps :
132
+ - uses : slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
133
+ with :
134
+ channel-id : " C07UG6JH44F" # notifications-container-images
135
+ payload : |
136
+ {
137
+ "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})",
138
+ "attachments": [
139
+ {
140
+ "pretext": "See the details below for a summary of which job(s) failed.",
141
+ "color": "#aa0000",
142
+ "fields": [
143
+ {
144
+ "title": "Generate Version List",
145
+ "short": true,
146
+ "value": "${{ needs.generate_matrix.result }}"
147
+ },
148
+ {
149
+ "title": "Build/Publish Image",
150
+ "short": true,
151
+ "value": "${{ needs.build.result }}"
152
+ },
153
+ {
154
+ "title": "Build/Publish Manifests",
155
+ "short": true,
156
+ "value": "${{ needs.publish_manifests.result }}"
157
+ }
158
+ ],
159
+ "actions": [
160
+ {
161
+ "type": "button",
162
+ "text": "Go to workflow run",
163
+ "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}"
164
+ }
165
+ ]
166
+ }
167
+ ]
168
+ }
169
+ env :
170
+ SLACK_BOT_TOKEN : ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
0 commit comments