1212 type : boolean
1313jobs :
1414 build :
15- name : Build and publish
15+ name : Build and publish ${{ matrix.os }}
1616 strategy :
1717 matrix :
1818 include :
1919 - os : ubuntu-24.04
20+ arch : amd64
2021 platforms : linux/amd64
2122 - os : ubuntu-24.04-arm
23+ arch : arm64
2224 platforms : linux/arm64
2325
2426 runs-on : ${{ matrix.os }}
@@ -40,20 +42,55 @@ jobs:
4042 username : ${{ secrets.DH_USERNAME }}
4143 password : ${{ secrets.DH_TOKEN }}
4244
43- - name : buildDocker
45+ - name : Build and push image ${{ matrix.platforms }}
4446 uses : docker/build-push-action@v6.16.0
4547 with :
4648 context : .
47- push : true
4849 platforms : ${{ matrix.platforms }}
49- tags : pcpl2/easy_image_cdn:latest,pcpl2/easy_image_cdn:${{ github.event.inputs.version }},ghcr.io/pcpl2/easy_image_cdn:latest,ghcr.io/pcpl2/easy_image_cdn:${{ github.event.inputs.version }}
50+ push : true
51+ tags : |
52+ pcpl2/easy_image_cdn:${{ github.event.inputs.version }}-${{ matrix.arch }}
53+ ghcr.io/pcpl2/easy_image_cdn:${{ github.event.inputs.version }}-${{ matrix.arch }}
5054 build-args : |
51- App_Version=${{ github.event.inputs.version }}
55+ App_Version=${{ github.event.inputs.version }}
56+
57+ manifest :
58+ name : Create multiarch manifest
59+ runs-on : ubuntu-latest
60+ needs : [build]
61+
62+ steps :
63+ - name : Login to Docker Hub
64+ uses : docker/login-action@v3.4.0
65+ with :
66+ username : ${{ secrets.DH_USERNAME }}
67+ password : ${{ secrets.DH_TOKEN }}
68+
69+ - name : Login to GitHub Container Registry
70+ uses : docker/login-action@v3.4.0
71+ with :
72+ registry : ghcr.io
73+ username : ${{ github.actor }}
74+ password : ${{ secrets.GH_TOKEN }}
75+
76+ - name : Create and push manifest (Docker Hub)
77+ run : |
78+ docker manifest create pcpl2/easy_image_cdn:${{ github.event.inputs.version }} \
79+ pcpl2/easy_image_cdn:${{ github.event.inputs.version }}-amd64 \
80+ pcpl2/easy_image_cdn:${{ github.event.inputs.version }}-arm64
81+ docker manifest push pcpl2/easy_image_cdn:${{ github.event.inputs.version }}
82+
83+ - name : Create and push manifest (GHCR)
84+ run : |
85+ docker manifest create ghcr.io/pcpl2/easy_image_cdn:${{ github.event.inputs.version }} \
86+ ghcr.io/pcpl2/easy_image_cdn:${{ github.event.inputs.version }}-amd64 \
87+ ghcr.io/pcpl2/easy_image_cdn:${{ github.event.inputs.version }}-arm64
88+ docker manifest push ghcr.io/pcpl2/easy_image_cdn:${{ github.event.inputs.version }}
5289
5390 createRelease :
5491 name : Create Release ${{ github.event.inputs.version }}
5592 runs-on : ubuntu-latest
56- needs : [ build ]
93+ needs : [ manifest ]
5794 steps :
5895 - name : Checkout repository
5996 uses : actions/checkout@v4.2.2
0 commit comments