|
| 1 | +name: Helm Chart Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + paths: |
| 7 | + - "charts/**" |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: write |
| 12 | + packages: write |
| 13 | + pages: write |
| 14 | + |
| 15 | +jobs: |
| 16 | + lint-test: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v6 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + |
| 24 | + - name: Set up Helm |
| 25 | + uses: azure/setup-helm@v4 |
| 26 | + with: |
| 27 | + version: v3.16.0 |
| 28 | + |
| 29 | + - name: Add Bitnami repo |
| 30 | + run: helm repo add bitnami https://charts.bitnami.com/bitnami |
| 31 | + |
| 32 | + - name: Set up Python (for chart-testing) |
| 33 | + uses: actions/setup-python@v5 |
| 34 | + with: |
| 35 | + python-version: "3.12" |
| 36 | + |
| 37 | + - name: Set up chart-testing |
| 38 | + uses: helm/chart-testing-action@v2.8.0 |
| 39 | + |
| 40 | + - name: Run chart-testing lint |
| 41 | + run: ct lint --target-branch ${{ github.event.repository.default_branch }} --charts charts/libredb-studio |
| 42 | + |
| 43 | + - name: Create Kind cluster |
| 44 | + uses: helm/kind-action@v1.14.0 |
| 45 | + |
| 46 | + - name: Run chart-testing install |
| 47 | + run: | |
| 48 | + ct install \ |
| 49 | + --target-branch ${{ github.event.repository.default_branch }} \ |
| 50 | + --charts charts/libredb-studio \ |
| 51 | + --helm-extra-set-args "\ |
| 52 | + --set secrets.jwtSecret=test-jwt-secret-minimum-32-characters-long \ |
| 53 | + --set secrets.adminPassword=TestAdmin123 \ |
| 54 | + --set secrets.userPassword=TestUser123" |
| 55 | +
|
| 56 | + release-github-pages: |
| 57 | + needs: lint-test |
| 58 | + runs-on: ubuntu-latest |
| 59 | + steps: |
| 60 | + - name: Checkout |
| 61 | + uses: actions/checkout@v6 |
| 62 | + with: |
| 63 | + fetch-depth: 0 |
| 64 | + |
| 65 | + - name: Configure Git |
| 66 | + run: | |
| 67 | + git config user.name "$GITHUB_ACTOR" |
| 68 | + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" |
| 69 | +
|
| 70 | + - name: Set up Helm |
| 71 | + uses: azure/setup-helm@v4 |
| 72 | + with: |
| 73 | + version: v3.16.0 |
| 74 | + |
| 75 | + - name: Add Bitnami repo |
| 76 | + run: helm repo add bitnami https://charts.bitnami.com/bitnami |
| 77 | + |
| 78 | + - name: Build chart dependencies |
| 79 | + run: helm dependency build charts/libredb-studio |
| 80 | + |
| 81 | + - name: Run chart-releaser |
| 82 | + uses: helm/chart-releaser-action@v1.7.0 |
| 83 | + env: |
| 84 | + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 85 | + |
| 86 | + release-oci: |
| 87 | + needs: lint-test |
| 88 | + runs-on: ubuntu-latest |
| 89 | + steps: |
| 90 | + - name: Checkout |
| 91 | + uses: actions/checkout@v6 |
| 92 | + |
| 93 | + - name: Set up Helm |
| 94 | + uses: azure/setup-helm@v4 |
| 95 | + with: |
| 96 | + version: v3.16.0 |
| 97 | + |
| 98 | + - name: Add Bitnami repo |
| 99 | + run: helm repo add bitnami https://charts.bitnami.com/bitnami |
| 100 | + |
| 101 | + - name: Login to GHCR |
| 102 | + run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin |
| 103 | + |
| 104 | + - name: Build dependencies |
| 105 | + run: helm dependency build charts/libredb-studio |
| 106 | + |
| 107 | + - name: Package chart |
| 108 | + run: helm package charts/libredb-studio -d .cr-release-packages |
| 109 | + |
| 110 | + - name: Push to OCI registry |
| 111 | + run: helm push .cr-release-packages/libredb-studio-*.tgz oci://ghcr.io/libredb/charts |
0 commit comments