55 branches :
66 - master
77
8+ env :
9+ REGISTRY_IMAGE : filigran/${{ github.event.repository.name }}
10+
811jobs :
12+
913 build :
10- runs-on : ubuntu-latest
14+ runs-on : ${{ matrix.runner }}
15+ strategy :
16+ matrix :
17+ include :
18+ - runner : ubuntu-latest
19+ platform : linux/amd64
20+ - runner : ubuntu-24.04-arm
21+ platform : linux/arm64
22+
1123 steps :
24+ - name : Prepare
25+ run : |
26+ platform=${{ matrix.platform }}
27+ echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
28+
29+ - name : Docker meta
30+ id : meta
31+ uses : docker/metadata-action@v5
32+ with :
33+ images : ${{ env.REGISTRY_IMAGE }}
34+
1235 - name : Login to Docker Hub
1336 uses : docker/login-action@v3
1437 with :
@@ -18,15 +41,77 @@ jobs:
1841 - name : Set up Docker Buildx
1942 uses : docker/setup-buildx-action@v3
2043
21- - name : Build and push
44+ - name : Build and push by digest
45+ id : build
2246 uses : docker/build-push-action@v6
2347 with :
24- push : true
25- tags : filigran/${{ github.event.repository.name }}:latest
48+ platforms : ${{ matrix.platform }}
49+ labels : ${{ steps.meta.outputs.labels }}
50+ tags : ${{ env.REGISTRY_IMAGE }}
51+ outputs : type=image,push-by-digest=true,name-canonical=true,push=true
52+
53+ - name : Export digest
54+ run : |
55+ mkdir -p ${{ runner.temp }}/digests
56+ digest="${{ steps.build.outputs.digest }}"
57+ touch "${{ runner.temp }}/digests/${digest#sha256:}"
58+
59+ - name : Upload digest
60+ uses : actions/upload-artifact@v4
61+ with :
62+ name : digests-${{ env.PLATFORM_PAIR }}
63+ path : ${{ runner.temp }}/digests/*
64+ if-no-files-found : error
65+ retention-days : 1
66+
67+ merge :
68+ runs-on : ubuntu-latest
69+ needs :
70+ - build
71+ steps :
72+ - name : Download digests
73+ uses : actions/download-artifact@v4
74+ with :
75+ path : ${{ runner.temp }}/digests
76+ pattern : digests-*
77+ merge-multiple : true
78+
79+ - name : Login to Docker Hub
80+ uses : docker/login-action@v3
81+ with :
82+ username : ${{ secrets.DOCKERHUB_USERNAME }}
83+ password : ${{ secrets.DOCKERHUB_TOKEN }}
2684
85+ - name : Set up Docker Buildx
86+ uses : docker/setup-buildx-action@v3
87+
88+ - name : Docker meta
89+ id : meta
90+ uses : docker/metadata-action@v5
91+ with :
92+ images : ${{ env.REGISTRY_IMAGE }}
93+ tags : |
94+ type=raw,value=latest
95+
96+ - name : Create manifest list and push
97+ working-directory : ${{ runner.temp }}/digests
98+ run : |
99+ docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
100+ $(printf 'filigran/${{ github.event.repository.name }}:latest@sha256:%s ' *)
101+
102+ - name : Inspect image
103+ run : |
104+ docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
105+
106+ deploy :
107+ name : deploy
108+ needs : [merge]
109+
110+ runs-on : ubuntu-latest
111+ steps :
27112 - name : Setup kubectl
28113 uses : azure/setup-kubectl@v3
29114
30115 - name : Redeploy on customer-dev
31116 run : |
32- kubectl --server=https://api.staging.eu-west.filigran.io --token=${{ secrets.K8S_TOKEN_DEV }} -n customer-dev rollout restart deployment -l app=xtm-composer
117+ kubectl --server=https://api.staging.eu-west.filigran.io --token=${{ secrets.K8S_TOKEN_DEV }} -n customer-dev rollout restart deployment -l app=xtm-composer
0 commit comments