55 workflows : ["Release Build"]
66 types :
77 - completed
8+
89env :
9- REGISTRY_IMAGE : quay .io/redlib /redlib
10+ REGISTRY_IMAGE : ghcr .io/algorithm5838 /redlib
1011
1112jobs :
1213 build :
1314 runs-on : ubuntu-latest
14- strategy :
15- fail-fast : false
16- matrix :
17- include :
18- - { platform: linux/amd64, target: x86_64-unknown-linux-musl }
19- - { platform: linux/arm64, target: aarch64-unknown-linux-musl }
20- - { platform: linux/arm/v7, target: armv7-unknown-linux-musleabihf }
15+ # Only build if the Release Build succeeded
16+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
2117 steps :
2218 - name : Checkout
2319 uses : actions/checkout@v4
20+
2421 - name : Docker meta
2522 id : meta
2623 uses : docker/metadata-action@v5
@@ -29,80 +26,29 @@ jobs:
2926 tags : |
3027 type=sha
3128 type=raw,value=latest,enable={{is_default_branch}}
32- - name : Set up QEMU
33- uses : docker/setup-qemu-action@v3
29+
3430 - name : Set up Docker Buildx
3531 uses : docker/setup-buildx-action@v3
36- - name : Login to Quay.io Container Registry
32+
33+ - name : Login to GitHub Container Registry
3734 uses : docker/login-action@v3
3835 with :
39- registry : quay .io
40- username : ${{ secrets.QUAY_USERNAME }}
41- password : ${{ secrets.QUAY_ROBOT_TOKEN }}
42- - name : Build and push
43- id : build
36+ registry : ghcr .io
37+ username : ${{ github.actor }}
38+ password : ${{ secrets.GITHUB_TOKEN }}
39+
40+ - name : Build and push (ARM64)
4441 uses : docker/build-push-action@v5
4542 with :
4643 context : .
47- platforms : ${{ matrix.platform }}
44+ platforms : linux/arm64
45+ push : true
46+ tags : ${{ steps.meta.outputs.tags }}
4847 labels : ${{ steps.meta.outputs.labels }}
49- outputs : type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
5048 file : Dockerfile
51- build-args : TARGET=${{ matrix.target }}
52- - name : Export digest
53- run : |
54- mkdir -p /tmp/digests
55- digest="${{ steps.build.outputs.digest }}"
56- touch "/tmp/digests/${digest#sha256:}"
57- - name : Upload digest
58- uses : actions/upload-artifact@v4
59- with :
60- name : digests-${{ matrix.target }}
61- path : /tmp/digests/*
62- if-no-files-found : error
63- retention-days : 1
64- merge :
65- runs-on : ubuntu-latest
66- needs :
67- - build
68- steps :
69- - name : Download digests
70- uses : actions/download-artifact@v4.1.7
71- with :
72- path : /tmp/digests
73- pattern : digests-*
74- merge-multiple : true
75-
76- - name : Set up Docker Buildx
77- uses : docker/setup-buildx-action@v3
78- - name : Docker meta
79- id : meta
80- uses : docker/metadata-action@v5
81- with :
82- images : ${{ env.REGISTRY_IMAGE }}
83- tags : |
84- type=sha
85- type=raw,value=latest,enable={{is_default_branch}}
86- - name : Login to Quay.io Container Registry
87- uses : docker/login-action@v3
88- with :
89- registry : quay.io
90- username : ${{ secrets.QUAY_USERNAME }}
91- password : ${{ secrets.QUAY_ROBOT_TOKEN }}
92- - name : Create manifest list and push
93- working-directory : /tmp/digests
94- run : |
95- docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
96- $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
97-
98- # - name: Push README to Quay.io
99- # uses: christian-korneck/update-container-description-action@v1
100- # env:
101- # DOCKER_APIKEY: ${{ secrets.APIKEY__QUAY_IO }}
102- # with:
103- # destination_container_repo: quay.io/redlib/redlib
104- # provider: quay
105- # readme_file: 'README.md'
49+ build-args : |
50+ TARGET=aarch64-unknown-linux-musl
51+ GITHUB_REPOSITORY=${{ github.repository }}
10652
10753 - name : Inspect image
10854 run : |
0 commit comments