Skip to content

Commit 4dfa10b

Browse files
committed
ci: push multi arch image to ghcr when release
Signed-off-by: Rory Z <[email protected]>
1 parent 4338777 commit 4dfa10b

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

.github/workflows/cts.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
workflow_dispatch:
55
schedule:
66
- cron: '0 */6 * * *'
7-
push:
8-
tags:
9-
- "*"
107

118
jobs:
129
test:
@@ -74,7 +71,7 @@ jobs:
7471
- uses: docker/metadata-action@v5
7572
id: meta
7673
with:
77-
images: ghcr.io/${{ github.repository }}
74+
images: ghcr.io/${{ github.repository_owner }}/emqx-operator-controller
7875
flavor: |
7976
latest=true
8077
tags: |
@@ -136,7 +133,7 @@ jobs:
136133
timeout-minutes: 5
137134
uses: ./.github/actions/deploy-operator
138135
with:
139-
repository: ghcr.io/${{ github.repository }}
136+
repository: ghcr.io/${{ github.repository_owner }}/emqx-operator-controller
140137
tag: ${{ github.ref_name }}
141138
- name: Deploy emqx
142139
timeout-minutes: 5

.github/workflows/release.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,27 @@ jobs:
2828
fi
2929
- uses: docker/setup-qemu-action@v3
3030
- uses: docker/setup-buildx-action@v3
31+
- uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ github.token }}
36+
- uses: docker/login-action@v3
37+
with:
38+
username: ${{ secrets.DOCKER_HUB_USER }}
39+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
3140
- uses: docker/metadata-action@v5
3241
id: meta
3342
with:
34-
images: ${{ github.repository_owner }}/emqx-operator-controller
43+
images: |
44+
${{ github.repository_owner }}/emqx-operator-controller
45+
ghcr.io/${{ github.repository_owner }}/emqx-operator-controller
3546
tags: |
3647
type=ref,event=branch
3748
type=ref,event=pr
3849
type=ref,event=tag
3950
type=semver,pattern={{version}}
4051
type=semver,pattern={{major}}.{{minor}}
41-
- uses: docker/login-action@v3
42-
if: startsWith(github.ref, 'refs/tags/')
43-
with:
44-
username: ${{ secrets.DOCKER_HUB_USER }}
45-
password: ${{ secrets.DOCKER_HUB_TOKEN }}
4652
- uses: docker/build-push-action@v5
4753
with:
4854
platforms: linux/amd64,linux/arm64,linux/arm/v7
@@ -65,7 +71,6 @@ jobs:
6571
echo "::set-output name=prerelease::true"
6672
fi
6773
- uses: softprops/action-gh-release@v1
68-
if: startsWith(github.ref, 'refs/tags/')
6974
with:
7075
prerelease: ${{ steps.prerelease.outputs.prerelease }}
7176
generate_release_notes: true

0 commit comments

Comments
 (0)