From 2686884566d8cfc61ebf96af22a65625a1d3fe26 Mon Sep 17 00:00:00 2001 From: a5r0n Date: Sat, 9 Dec 2023 18:58:26 +0200 Subject: [PATCH] ci(actions): Add oci push action --- .github/workflows/push-chart.yml | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/push-chart.yml diff --git a/.github/workflows/push-chart.yml b/.github/workflows/push-chart.yml new file mode 100644 index 0000000..51492c1 --- /dev/null +++ b/.github/workflows/push-chart.yml @@ -0,0 +1,34 @@ +name: Push Helm chart to OCI + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + id: checkout + - uses: azure/setup-helm@v3 + id: install_helm + - name: Build Helm chart + run: | + helm package ./n8n + - name: Login to Helm OCI + run: | + echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ vars.OCI_REGISTRY }} --username ${{ github.repository_owner }} --password-stdin + - name: Push Helm chart to OCI + run: | + helm push n8n-*.tgz oci://${{ vars.OCI_REGISTRY }}/${{ vars.OCI_REPOSITORY }} + - name: Update README.md with Helm chart version + run: | + sed -i "s/--version .*/--version: $(grep -oP '^version: \K.*' n8n/Chart.yaml)/" README.md + - name: Commit and push changes + run: | + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor }}@users.noreply.github.com" + git add README.md + git commit -m "relase: Update Helm chart version to $(grep -oP '^version: \K.*' n8n/Chart.yaml)" + git push