Skip to content

Commit

Permalink
ci: push multi arch image to ghcr when release
Browse files Browse the repository at this point in the history
Signed-off-by: Rory Z <[email protected]>
  • Loading branch information
Rory-Z committed Jul 25, 2024
1 parent 4338777 commit 7305791
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/cts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
push:
tags:
- "*"

jobs:
test:
Expand Down Expand Up @@ -74,7 +71,7 @@ jobs:
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
images: ghcr.io/${{ github.repository_owner }}/emqx-operator-controller
flavor: |
latest=true
tags: |
Expand Down Expand Up @@ -136,7 +133,7 @@ jobs:
timeout-minutes: 5
uses: ./.github/actions/deploy-operator
with:
repository: ghcr.io/${{ github.repository }}
repository: ghcr.io/${{ github.repository_owner }}/emqx-operator-controller
tag: ${{ github.ref_name }}
- name: Deploy emqx
timeout-minutes: 5
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,27 @@ jobs:
fi
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ github.repository_owner }}/emqx-operator-controller
images: |
${{ github.repository_owner }}/emqx-operator-controller
ghcr.io/${{ github.repository_owner }}/emqx-operator-controller
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- uses: docker/login-action@v3
if: startsWith(github.ref, 'refs/tags/')
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
Expand All @@ -65,7 +71,6 @@ jobs:
echo "::set-output name=prerelease::true"
fi
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: ${{ steps.prerelease.outputs.prerelease }}
generate_release_notes: true
Expand Down

0 comments on commit 7305791

Please sign in to comment.