@@ -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 oci.stackable.tech
73- uses : stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
74- with :
75- image-registry-uri : oci.stackable.tech
76- image-registry-username : robot$sdp+github-action-build
77- image-registry-password : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
78- image-repository : sdp/${{ 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- publish_manifests :
83- name : Build/Publish ${{ matrix.versions }} Manifests
84- needs : [generate_matrix, build]
85- permissions :
86- id-token : write
87- runs-on : ubuntu-latest
88- strategy :
89- fail-fast : false
90- matrix :
91- versions : ${{ fromJson(needs.generate_matrix.outputs.versions) }}
92- steps :
93- - name : Checkout Repository
94- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
95- with :
96- persist-credentials : false
97-
98- - name : Publish and Sign Image Index Manifest to oci.stackable.tech
99- uses : stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
100- with :
101- image-registry-uri : oci.stackable.tech
102- image-registry-username : robot$sdp+github-action-build
103- image-registry-password : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
104- image-repository : sdp/${{ env.PRODUCT_NAME }}
105- image-index-manifest-tag : ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }}
106-
107- notify :
108- name : Failure Notification
109- needs : [generate_matrix, build, publish_manifests]
110- runs-on : ubuntu-latest
111- if : failure()
112- steps :
113- - uses : slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
114- with :
115- channel-id : " C07UG6JH44F" # notifications-container-images
116- payload : |
117- {
118- "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})",
119- "attachments": [
120- {
121- "pretext": "See the details below for a summary of which job(s) failed.",
122- "color": "#aa0000",
123- "fields": [
124- {
125- "title": "Generate Version List",
126- "short": true,
127- "value": "${{ needs.generate_matrix.result }}"
128- },
129- {
130- "title": "Build/Publish Image",
131- "short": true,
132- "value": "${{ needs.build.result }}"
133- },
134- {
135- "title": "Build/Publish Manifests",
136- "short": true,
137- "value": "${{ needs.publish_manifests.result }}"
138- }
139- ],
140- "actions": [
141- {
142- "type": "button",
143- "text": "Go to workflow run",
144- "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}"
145- }
146- ]
147- }
148- ]
149- }
150- env :
151- 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