@@ -3,10 +3,6 @@ name: Build Airflow
33run-name : |
44 Build Airflow (attempt #${{ github.run_attempt }})
55
6- env :
7- PRODUCT_NAME : airflow
8- SDP_VERSION : ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}
9-
106on :
117 workflow_dispatch :
128 schedule :
2218 - stackable-base/**
2319 - .github/actions/**
2420 - .github/workflows/build_airflow.yaml
21+ - .github/workflows/reusable_build_image.yaml
2522
2623jobs :
27- generate_matrix :
28- name : Generate Version List
29- runs-on : ubuntu-latest
30- steps :
31- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
32- with :
33- persist-credentials : false
34- - id : shard
35- uses : stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
36- with :
37- product-name : ${{ env.PRODUCT_NAME }}
38- outputs :
39- versions : ${{ steps.shard.outputs.versions }}
40-
41- build :
42- name : Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image
43- needs : [generate_matrix]
44- permissions :
45- id-token : write
46- runs-on : ${{ matrix.runner.name }}
47- strategy :
48- fail-fast : false
49- matrix :
50- runner :
51- - {name: "ubuntu-latest", arch: "amd64"}
52- - {name: "ubicloud-standard-8-arm", arch: "arm64"}
53- versions : ${{ fromJson(needs.generate_matrix.outputs.versions) }}
54- steps :
55- - name : Checkout Repository
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@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
62-
63- - name : Build Product Image
64- id : build
65- uses : stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
66- with :
67- product-name : ${{ env.PRODUCT_NAME }}
68- product-version : ${{ matrix.versions }}
69- build-cache-password : ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }}
70- sdp-version : ${{ env.SDP_VERSION }}
71-
72- - name : Publish Container Image on docker.stackable.tech
73- uses : stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
74- with :
75- image-registry-uri : docker.stackable.tech
76- image-registry-username : github
77- image-registry-password : ${{ secrets.NEXUS_PASSWORD }}
78- image-repository : stackable/${{ env.PRODUCT_NAME }}
79- image-manifest-tag : ${{ steps.build.outputs.image-manifest-tag }}
80- source-image-uri : localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }}
81-
82- - name : Publish Container Image on oci.stackable.tech
83- uses : stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
84- with :
85- image-registry-uri : oci.stackable.tech
86- image-registry-username : robot$sdp+github-action-build
87- image-registry-password : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
88- image-repository : sdp/${{ env.PRODUCT_NAME }}
89- image-manifest-tag : ${{ steps.build.outputs.image-manifest-tag }}
90- source-image-uri : localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }}
91-
92- publish_manifests :
93- name : Build/Publish ${{ matrix.versions }} Manifests
94- needs : [generate_matrix, build]
95- permissions :
96- id-token : write
97- runs-on : ubuntu-latest
98- strategy :
99- fail-fast : false
100- matrix :
101- versions : ${{ fromJson(needs.generate_matrix.outputs.versions) }}
102- steps :
103- - name : Checkout Repository
104- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
105- with :
106- persist-credentials : false
107-
108- - name : Publish and Sign Image Index Manifest to docker.stackable.tech
109- uses : stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
110- with :
111- image-registry-uri : docker.stackable.tech
112- image-registry-username : github
113- image-registry-password : ${{ secrets.NEXUS_PASSWORD }}
114- image-repository : stackable/${{ env.PRODUCT_NAME }}
115- image-index-manifest-tag : ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }}
116-
117- - name : Publish and Sign Image Index Manifest to oci.stackable.tech
118- uses : stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
119- with :
120- image-registry-uri : oci.stackable.tech
121- image-registry-username : robot$sdp+github-action-build
122- image-registry-password : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
123- image-repository : sdp/${{ env.PRODUCT_NAME }}
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 }}
24+ build_image :
25+ name : Reusable Workflow
26+ uses : ./.github/workflows/reusable_build_image.yaml
27+ secrets :
28+ harbor-robot-secret : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
29+ slack-token : ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
30+ with :
31+ product-name : airflow
32+ sdp-version : ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}
0 commit comments