Skip to content

run helm push only once #8

run helm push only once

run helm push only once #8

Workflow file for this run

name: ci
on:
push:
tags:
- 'v*'
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- dockerfile: ./cmd/public/Dockerfile
name: public
- dockerfile: ./cmd/service-artist/Dockerfile
name: service-artist
- dockerfile: ./cmd/service-price/Dockerfile
name: service-price
- dockerfile: ./cmd/service-title/Dockerfile
name: service-title
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/enesonus/jaeger-demo-${{ matrix.name }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push images
uses: docker/build-push-action@v4
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Prepare metadata for Helm
if: matrix.name == 'public'
id: meta_chart
uses: docker/metadata-action@v3
with:
images: ghcr.io/enesonus/jaeger-demo-chart
tags: |
type=semver,pattern={{version}}
- name: Build and push the chart
if: matrix.name == 'public'
run: |
helm registry login -u {{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
helm package --version {{ steps.meta_chart.outputs.tags }} ./cluster/charts/jaeger-demo
helm push jaeger-demo-{{ steps.meta_chart.outputs.tags }}.tgz ghcr.io/enesonus/jaeger-demo