88 - v[0-9]+.*
99jobs :
1010 build-image :
11- name : Build Docker Image
12- runs-on : ubuntu-latest
11+ name : Build Docker Image (${{ matrix.platform }})
12+ runs-on : ${{ matrix.runner }}
13+ strategy :
14+ matrix :
15+ include :
16+ - platform : amd64
17+ runner : ubuntu-24.04
18+ - platform : arm64
19+ runner : ubuntu-24.04-arm
1320 steps :
1421 - name : Checkout Code
1522 uses : actions/checkout@v4
@@ -19,16 +26,32 @@ jobs:
1926 registry : ghcr.io
2027 username : supleed2
2128 password : ${{ secrets.GITHUB_TOKEN }}
22- - name : Set up QEMU
23- uses : docker/setup-qemu-action@v3
2429 - name : Set up Docker Buildx
2530 uses : docker/setup-buildx-action@v3
2631 - name : Build and Push Docker Image
2732 uses : docker/build-push-action@v6
2833 with :
2934 context : .
30- platforms : linux/amd64,linux/arm64
35+ platforms : linux/${{ matrix.platform }}
3136 push : true
32- tags : |
33- ghcr.io/supleed2/nanobot:${{ github.ref_name }}
34- ghcr.io/supleed2/nanobot:latest
37+ tags : ghcr.io/supleed2/nanobot:${{ github.ref_name }}-${{ matrix.platform }}
38+ merge-manifests :
39+ name : Merge Manifests
40+ runs-on : ubuntu-24.04
41+ needs : build-image
42+ steps :
43+ - name : Log in to GitHub Container Registry
44+ uses : docker/login-action@v3
45+ with :
46+ registry : ghcr.io
47+ username : supleed2
48+ password : ${{ secrets.GITHUB_TOKEN }}
49+ - name : Set up Docker Buildx
50+ uses : docker/setup-buildx-action@v3
51+ - name : Create Multi-Platform Image
52+ run : >
53+ docker buildx imagetools create
54+ -t ghcr.io/supleed2/nanobot:latest
55+ -t ghcr.io/supleed2/nanobot:${{ github.ref_name }}
56+ ghcr.io/supleed2/nanobot:${{ github.ref_name }}-amd64
57+ ghcr.io/supleed2/nanobot:${{ github.ref_name }}-arm64
0 commit comments