|
| 1 | +# This action releases the chimera-controller helm chart |
| 2 | +# The action must run on each commit done against master, however |
| 3 | +# a new release will be performed **only** when a change occurs inside |
| 4 | +# of the `charts` directory. |
| 5 | +# |
| 6 | +# When the helm chart is changed, this action will: |
| 7 | +# * Create a new GitHub release named: chimera-controller-chart |
| 8 | +# * This release has a chimera-controller-chart.tar.gz asset associated with |
| 9 | +# it. This is the actual helm chart |
| 10 | +# * Update the `index.yaml` file inside of the `gh-pages` branch. This is the |
| 11 | +# index of the helm chart repository, which we serve through GitHub pages |
| 12 | +# |
| 13 | +# = FAQ |
| 14 | +# |
| 15 | +# == Why don't we run this action only when a tag like `v*` is created? |
| 16 | +# |
| 17 | +# Running the action only when a "release tag" is created will not produce |
| 18 | +# a helm chart. That happens because the code which determines if something |
| 19 | +# changed inside of the `charts` directory will not find any changes. |
| 20 | +# |
| 21 | +# == The action is just a "wrapper" around the official `github.com/helm/chart-releaser` tool, can't we just create our own action? |
| 22 | +# |
| 23 | +# Yes, we even got that to work. However, what we really want to do is the |
| 24 | +# ability to tag the releases of the chimera-controller and its helm chart |
| 25 | +# in an independent way. Which what the official GitHub action already does. |
| 26 | + |
| 27 | +name: Release helm chart |
| 28 | + |
| 29 | +on: |
| 30 | + push: |
| 31 | + branches: |
| 32 | + - main |
| 33 | + |
| 34 | +jobs: |
| 35 | + release: |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - name: Checkout |
| 39 | + uses: actions/checkout@v2 |
| 40 | + with: |
| 41 | + fetch-depth: 0 |
| 42 | + |
| 43 | + - name: Configure Git |
| 44 | + run: | |
| 45 | + git config user.name "$GITHUB_ACTOR" |
| 46 | + git config user.email "[email protected]" |
| 47 | +
|
| 48 | + - name: Install Helm |
| 49 | + uses: azure/setup-helm@v1 |
| 50 | + with: |
| 51 | + version: v3.4.0 |
| 52 | + |
| 53 | + - name: Run chart-releaser |
| 54 | + |
| 55 | + with: |
| 56 | + charts_dir: charts |
| 57 | + env: |
| 58 | + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
0 commit comments