Feat adding template config #4
This file contains 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: PR - release charts | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- master | |
paths: | |
- 'charts/node-local-dns/**' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.12.1 | |
- name: Add dependency chart repos | |
run: | | |
helm repo add stable https://charts.helm.sh/stable | |
helm repo add incubator https://charts.helm.sh/incubator | |
- name: Get version | |
id: get_version | |
run: | | |
version=$(grep 'version: ' charts/node-local-dns/Chart.yaml | awk '{print $2}') | |
branch=$GITHUB_HEAD_REF | |
pr_version="${version}-${branch}" | |
echo "Defining PR version $pr_version for branch $branch" | |
echo "Updating charts/node-local-dns/Chart.yaml version to ${pr_version}" | |
sed -i "s/^version:.*/version: ${pr_version}/" charts/node-local-dns/Chart.yaml | |
echo "{pr_version}={$pr_version}" >> $GITHUB_OUTPUT | |
- name: Run chart-releaser | |
uses: helm/[email protected] | |
with: | |
version: $pr_version | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |