44 branches : [main]
55jobs :
66 build :
7- runs-on : ${{ matrix.os }}
8- strategy :
9- matrix :
10- include :
11- - os : ubuntu-24.04
12- platform : amd64
13- - os : ubuntu-24.04-arm
14- platform : arm64
7+ runs-on : ubuntu-latest
158 steps :
169 - uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
1710
11+ - run : docker login --username '${{ github.actor }}' --password-stdin ghcr.io <<< "$GHCR_TOKEN"
12+ env :
13+ GHCR_TOKEN : ${{ secrets.GITHUB_TOKEN }}
14+ if : github.event_name != 'pull_request'
15+
1816 - run : docker buildx create --driver docker-container --use
1917
2018 - name : build
@@ -23,75 +21,24 @@ jobs:
2321
2422 if [ ${{ github.event_name }} = 'push' ]; then
2523 args=(
26- --output type=tar,dest=/tmp/taskbroker-${{ matrix.platform }}.tar
24+ --tag ghcr.io/getsentry/taskbroker:latest
25+ --tag ghcr.io/getsentry/taskbroker:amd64-latest
26+ --push
2727 )
2828 else
2929 args=()
3030 fi
3131
3232 docker buildx build \
3333 --pull \
34- --platform linux/${{ matrix.platform }} \
34+ --platform linux/amd64 \
3535 --build-arg "TASKBROKER_GIT_REVISION=${{ github.sha }}" \
3636 --cache-from ghcr.io/getsentry/taskbroker:latest \
3737 --cache-to type=inline \
38- --tag taskbroker:${{ matrix.platform }} \
38+ --tag ghcr.io/getsentry/ taskbroker:${{ github.sha }} \
3939 "${args[@]}" \
4040 .
4141
42- - name : Upload Image
43- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
44- if : ${{ github.event_name != 'pull_request' }}
45- with :
46- name : taskbroker-${{ matrix.platform }}
47- path : /tmp/taskbroker-${{ matrix.platform }}.tar
48-
49- assemble-taskbroker-image :
50- runs-on : ubuntu-latest
51- needs : [build]
52- if : ${{ github.event_name != 'pull_request' }}
53- steps :
54- - uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
55-
56- - run : docker login --username '${{ github.actor }}' --password-stdin ghcr.io <<< "$GHCR_TOKEN"
57- env :
58- GHCR_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59-
60- - run : docker buildx create --driver docker-container --use
61-
62- - name : Download amd64 Image
63- uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.2
64- with :
65- name : taskbroker-amd64
66- path : /tmp
67-
68- - name : Load amd64 Image
69- run : docker load --input /tmp/taskbroker-amd64.tar
70-
71- - name : Download arm64 Image
72- uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.2
73- with :
74- name : taskbroker-arm64
75- path : /tmp
76-
77- - name : Load arm64 Image
78- run : docker load --input /tmp/taskbroker-arm64.tar
79-
80- - name : Push to GitHub Container Registry
81- run : |
82- docker tag taskbroker:amd64 ghcr.io/getsentry/taskbroker:${{ github.sha }}-amd64
83- docker push ghcr.io/getsentry/taskbroker:${{ github.sha }}-amd64
84- docker tag taskbroker:arm64 ghcr.io/getsentry/taskbroker:${{ github.sha }}-arm64
85- docker push ghcr.io/getsentry/taskbroker:${{ github.sha }}-arm64
86-
87- docker manifest create \
88- ghcr.io/getsentry/taskbroker:${{ github.sha }} \
89- ghcr.io/getsentry/taskbroker:latest \
90- --amend ghcr.io/getsentry/taskbroker:${{ github.sha }}-amd64 \
91- --amend ghcr.io/getsentry/taskbroker:${{ github.sha }}-arm64
92-
93- docker manifest push ghcr.io/getsentry/taskbroker:${{ github.sha }}
94-
9542 publish-taskbroker-to-dockerhub :
9643 runs-on : ubuntu-latest
9744 if : ${{ github.ref_name == 'main' }}
0 commit comments