-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (53 loc) · 1.7 KB
/
chart-push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: "Push chart to ghcr.io"
on:
push:
paths:
- charts/myprecious/Chart.yaml
branches:
- main
workflow_dispatch:
permissions:
contents: write
packages: write
env:
HELM_VERSION: 3.11.2
CHARTS_SRC_DIR: "."
TARGET_REGISTRY: ghcr.io
TARGET_REPO: elfhosted/myprecious
jobs:
release-charts:
name: Release charts
runs-on: ubuntu-latest
steps:
- name: Checkout chart sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Install Kubernetes tools
uses: yokawasa/action-setup-kube-tools@v0.9.3
with:
setup-tools: |
helm
yq
helm: "${{ env.HELM_VERSION }}"
- name: Log into helm repo
shell: bash
run: |
helm registry login ghcr.io/elfhosted/charts -u ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}
- name: Package & Push Helm Charts
shell: bash
run: |
CHART_VERSION=$(yq e '.version' charts/myprecious/Chart.yaml)
helm package charts/myprecious --dependency-update --destination . --version "${CHART_VERSION}"
helm push myprecious-${CHART_VERSION}.tgz oci://${{ env.TARGET_REGISTRY }}/${{ env.TARGET_REPO }}
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Trigger flux to reconcile HelmRepository
run: |
curl -X POST ${{ secrets.FLUX_WEBHOOK_URL }}