diff --git a/.github/workflows/chart.yaml b/.github/workflows/chart.yaml new file mode 100644 index 0000000..2edade8 --- /dev/null +++ b/.github/workflows/chart.yaml @@ -0,0 +1,50 @@ +name: 'Publish helm chart' +on: + push: + branches: + - 'main' + paths: + - 'deploy/**' + - '.github/workflows/chart.yaml' + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - + name: Install Helm + uses: azure/setup-helm@v4 + with: + version: 3.* + + - name: Replace version + run: | + sed -i "/^version:/ s/$/-$(date +%Y%m%d%H%M%S)/" deploy/*/Chart.yaml + + - + name: Package charts + run: | + for chart in deploy/*; do + if [ -e "$chart/Chart.yaml" ]; then + helm package "$chart" + fi + done + + - + name: Login to GHCR + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push charts + run: | + for pkg in *.tgz; do + helm push "$pkg" oci://ghcr.io/kmc-jp/cert-manager-webhook-pdns + done