From a0ca073c599d43b81e28dad822b0e00658a6a807 Mon Sep 17 00:00:00 2001 From: Lyubo Kamenov Date: Wed, 2 Oct 2024 16:44:49 -0400 Subject: [PATCH] Add conduit docker image and release (#32) * Add conduit docker image and release * add helm chart build --- .github/workflows/release.yml | 79 ++++++++++++++++++++++++++++++ charts/conduit-operator/Chart.yaml | 2 +- 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3016fb6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,79 @@ +name: Release +on: + push: + tags: + - v* + +permissions: + contents: write + +jobs: + build-push-helm-chart: + name: Build and push Helm chart pkg + runs-on: ubuntu-latest + env: + BUILD_DIR: ${{ github.workspace }}/charts/build" + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: ${{ github.repository }} + ref: gh-pages + path: tmp/charts + - name: Package Helm Chart + run: | + mkdir -p ${BUILD_DIR} + scripts/package-chart charts/conduit-operator ${BUILD_DIR} ${BUILD_DIR}/index.yaml + ls -all ${BUILD_DIR} + cat ${BUILD_DIR}/index.yaml" + - name: Release Helm Chart + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ${BUILD_DIR} + keep_files: true + + build-push-docker-image: + name: Build and push Docker image + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3.3.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.5.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{raw}} + type=raw,value=latest-nightly,enable=${{ contains(github.ref, '-nightly') }} + type=semver,pattern=v{{major}}.{{minor}},enable=${{ !contains(github.ref, '-nightly') }} + type=semver,pattern=v{{major}},enable=${{ !contains(github.ref, '-nightly') && !startsWith(github.ref, 'refs/tags/v0.') }} + labels: | + maintainer=ConduitIO + org.opencontainers.image.title=Conduit-Operator + org.opencontainers.image.description=Conduit Operator manages Conduit instances on Kubernetes + org.opencontainers.image.vendor=ConduitIO + + - name: Build and push Docker image + uses: docker/build-push-action@v6.9.0 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + diff --git a/charts/conduit-operator/Chart.yaml b/charts/conduit-operator/Chart.yaml index 31a090c..a15010c 100644 --- a/charts/conduit-operator/Chart.yaml +++ b/charts/conduit-operator/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: conduit-operator -description: A Helm chart for the Conduit manager +description: A Helm chart for the Conduit data stream tool type: application version: 0.1.0 appVersion: "0.1.0"