adding chart releaser flow #184
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint, Test and Deploy Charts | |
on: | |
push: | |
jobs: | |
lint-test: | |
name: "Lint and Test" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v2.4.2 | |
with: | |
fetch-depth: 0 | |
- name: "Set Up Helm" | |
uses: azure/setup-helm@v3.3 | |
if: github.ref != 'refs/heads/main' | |
with: | |
version: v3.4.1 | |
- name: "Set Up Python" | |
uses: actions/setup-python@v4.2.0 | |
if: github.ref != 'refs/heads/main' | |
with: | |
python-version: 3.9 | |
- name: "Set up chart-testing" | |
uses: helm/chart-testing-action@v2.3.0 | |
if: github.ref != 'refs/heads/main' | |
with: | |
version: v3.3.0 | |
- name: "Run chart-testing (list-changed)" | |
id: list-changed | |
if: github.ref != 'refs/heads/main' | |
run: | | |
changed=$(ct list-changed --config ct.yaml) | |
if [[ -n "$changed" ]]; then | |
echo "::set-output name=changed::true" | |
fi | |
- name: "Run chart-testing (lint)" | |
run: ct lint --config ct.yaml | |
if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main' | |
- name: Create kind cluster | |
uses: helm/kind-action@v1.4.0 | |
if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main' | |
- name: Run chart-testing (install) | |
run: ct install --config ct.yaml | |
if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main' | |
release: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: | |
- lint-test | |
name: "Release Chart on GH" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
- name: Install Helm | |
uses: azure/setup-helm@v1 | |
with: | |
version: v3.4.0 | |
- name: Run chart-releaser | |
uses: helm/chart-releaser-action@v1.0.0 | |
env: | |
CR_TOKEN: '${{ secrets.CR_TOKEN }}' |