ci: release helm chars when push tags #69
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build image | |
on: | |
push: | |
branches: | |
- "**" | |
tags: | |
- "v*.*.*" | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/${{ github.repository }} | |
uhub.service.ucloud.cn/${{ github.repository }} | |
${{ secrets.DOCKERHUB_USERNAME }}/opengemini-operator | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
labels: | | |
org.opencontainers.image.title=opengemini-operator | |
org.opencontainers.image.description=opengemini-operator makes deploy and manage openGemini clusters more easily!!! | |
org.opencontainers.image.vendor=It is maintained by the official opengemini team. | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to GitHub Container Registry | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Login to UCloud | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
uses: docker/login-action@v3 | |
with: | |
registry: uhub.service.ucloud.cn | |
username: ${{ secrets.UCLOUD_USERNAME }} | |
password: ${{ secrets.UCLOUD_PASSWORD }} | |
- name: Login to Docker Hub | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |