88
99jobs :
1010 push :
11- strategy :
12- matrix :
13- include :
14- - platform : linux/amd64
15- runner : ubuntu-latest
16- - platform : linux/arm64
17- runner : ubuntu-arm64
18- runs-on : ${{ matrix.runner }}
11+ runs-on : ubuntu-latest
1912 name : Build and push graphmindset image
20- env :
21- ACTIONS_ALLOW_UNSECURE_COMMANDS : true
2213 steps :
2314 - name : Check out from Git
2415 uses : actions/checkout@v4
@@ -29,49 +20,22 @@ jobs:
2920 with :
3021 username : ${{ secrets.DOCKER_USERNAME }}
3122 password : ${{ secrets.DOCKER_PASSWORD }}
32- - name : Set up QEMU
33- uses : docker/setup-qemu-action@v3
3423 - name : Set up Docker Buildx
3524 uses : docker/setup-buildx-action@v3
3625 id : buildx
37- - name : Show available buildx platforms
38- run : echo ${{ steps.buildx.outputs.platforms }}
3926 - name : Cache Docker layers
4027 uses : actions/cache@v4
4128 id : cache
4229 with :
4330 path : /tmp/.buildx-cache
44- key : ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.platform }}
31+ key : ${{ runner.os }}-buildx-${{ github.sha }}
4532 restore-keys : |
46- ${{ runner.os }}-buildx-${{ matrix.platform }}-
33+ ${{ runner.os }}-buildx-
4734 - name : Run Docker buildx
4835 run : |
49- PLATFORM_TAG=$(echo ${{ matrix.platform }} | tr '/' '-')
5036 docker buildx build \
51- --platform ${{ matrix.platform }} \
52- --tag "${{ secrets.DOCKER_HUB_USER }}/graphmindset:${{ env.RELEASE_TAG }}-${PLATFORM_TAG} " \
53- --cache-from "type=registry,ref= ${{ secrets.DOCKER_HUB_USER }}/graphmindset:cache-${PLATFORM_TAG} " \
54- --cache-to "type=registry,image-manifest=true,oci-mediatypes=true,mode=max,ref=${{ secrets.DOCKER_HUB_USER }}/graphmindset:cache-${PLATFORM_TAG} " \
37+ --platform linux/amd64 \
38+ --tag "${{ secrets.DOCKER_HUB_USER }}/graphmindset:${{ env.RELEASE_TAG }}" \
39+ --tag " ${{ secrets.DOCKER_HUB_USER }}/graphmindset:latest " \
40+ --cache-to "type=local,dest=/tmp/.buildx-cache " \
5541 --output "type=registry" ./
56-
57- create-manifest :
58- runs-on : ubuntu-latest
59- needs : push
60- name : Create multi-platform manifest
61- steps :
62- - name : Check out from Git
63- uses : actions/checkout@v4
64- - name : Set release tag
65- run : echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
66- - name : Login to Docker Hub
67- uses : docker/login-action@v3
68- with :
69- username : ${{ secrets.DOCKER_USERNAME }}
70- password : ${{ secrets.DOCKER_PASSWORD }}
71- - name : Create and push multi-platform manifest
72- run : |
73- docker buildx imagetools create \
74- --tag "${{ secrets.DOCKER_HUB_USER }}/graphmindset:${{ env.RELEASE_TAG }}" \
75- --tag "${{ secrets.DOCKER_HUB_USER }}/graphmindset:latest" \
76- "${{ secrets.DOCKER_HUB_USER }}/graphmindset:${{ env.RELEASE_TAG }}-linux-amd64" \
77- "${{ secrets.DOCKER_HUB_USER }}/graphmindset:${{ env.RELEASE_TAG }}-linux-arm64"
0 commit comments