Skip to content

feat: release docker image to ghcr #25

feat: release docker image to ghcr

feat: release docker image to ghcr #25

name: Build and Publish Images
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
jobs:
build-and-publish:
name: Build and Publish Images
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- component-name: databend-operator
dockerfile: ./Dockerfile
platforms: linux/amd64,linux/arm64
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Push Flag
id: set-push
run: |
if [[ "${{ github.event_name }}" == "push" && (${{ github.ref == 'refs/heads/main' }} || ${{ startsWith(github.ref, 'refs/tags/') }})]]; then
echo "push=true" >> $GITHUB_OUTPUT
else
echo "push=false" >> $GITHUB_OUTPUT
fi
- name: Build And Publish Component ${{ matrix.component-name }}
uses: ./.github/workflows/template-publish-image
with:
image: ${{ matrix.component-name }}
dockerfile: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
context: ${{ matrix.context || '.' }}
push: ${{ steps.set-push.outputs.push }}
github_token: ${{ secrets.GITHUB_TOKEN }}