Skip to content

Commit

Permalink
feat: Add Helm CD action (#8746)
Browse files Browse the repository at this point in the history
* restore helm cd action

* update cd helm
  • Loading branch information
floreks authored Mar 6, 2024
1 parent 3406310 commit 2a922df
Showing 1 changed file with 65 additions and 62 deletions.
127 changes: 65 additions & 62 deletions .github/workflows/cd-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,65 +12,68 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# TODO: Enable once helm chart is updated
#name: CD / Helm
#
#on:
# push:
# branches: [ master ]
#
#jobs:
# lint-test:
# name: Lint and test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/[email protected]
# with:
# fetch-depth: 0
# - uses: azure/[email protected]
# with:
# version: v3.12.1
# - uses: helm/[email protected]
# - id: list-changed
# run: |
# changed=$(ct list-changed --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }})
# if [[ -n "$changed" ]]; then
# echo "changed=true" >> "$GITHUB_OUTPUT"
# fi
# - if: steps.list-changed.outputs.changed == 'true'
# run: ct lint --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }}
# - if: steps.list-changed.outputs.changed == 'true'
# uses: helm/[email protected]
# with:
# node_image: kindest/node:v1.29.0
# - if: steps.list-changed.outputs.changed == 'true'
# run: ct install --target-branch ${{ github.event.repository.default_branch }}
#
# release:
# name: Helm chart release
# runs-on: ubuntu-latest
# needs: [ 'lint-test' ]
# permissions:
# contents: write
# steps:
# - name: Check out repository
# uses: actions/[email protected]
# with:
# fetch-depth: 0
#
# - name: Set up Git user
# run: |
# git config user.name "$GITHUB_ACTOR"
# git config user.email "[email protected]"
#
# - name: Set up Helm
# uses: azure/[email protected]
# with:
# version: v3.12.1
#
# - name: Run chart-releaser
# uses: helm/[email protected]
# with:
# skip_existing: true
# env:
# CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
name: CD / Helm

on:
push:
paths:
- 'charts/**'
branches:
- master

jobs:
lint-test:
name: Lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: azure/[email protected]
with:
version: v3.12.1
- uses: helm/[email protected]
- id: list-changed
run: |
changed=$(ct list-changed --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }}
- if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]
with:
node_image: kindest/node:v1.29.0
- if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}

release:
name: Helm chart release
runs-on: ubuntu-latest
needs: [ 'lint-test' ]
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Set up Git user
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.12.1

- name: Run chart-releaser
uses: helm/[email protected]
with:
skip_existing: true
mark_as_latest: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 comments on commit 2a922df

Please sign in to comment.