Release Charts #3
Workflow file for this run
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: Release Charts | |
# Can be run via `gh workflow run release-charts.yml -f chartName=<peerdb|peerdb-catalog>` | |
# Do not change this | |
concurrency: release-helm | |
on: | |
workflow_dispatch: | |
inputs: | |
chartName: | |
type: choice | |
description: Chart to Release | |
required: true | |
options: | |
- peerdb | |
- peerdb-catalog | |
env: | |
HELM_REPO_URL: "https://peerdb-io.github.io/peerdb-enterprise" | |
jobs: | |
release-chart: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: 'src' | |
fetch-depth: 0 | |
submodules: true | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
path: 'dest' | |
ref: 'gh-pages' | |
fetch-depth: 0 | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
- name: Package Helm Charts | |
shell: bash | |
run: | | |
set -e | |
declare -a chartNames=( | |
"${{ github.event.inputs.chartName }}" | |
) | |
for chart in "${chartNames[@]}" | |
do | |
test -f dest/$(helm show chart "src/${chart}" | yq '.name + "-" + .version + ".tgz"') && echo "Existing Chart with same version found" 2>&1 && exit 1 | |
echo "Updating and packaging ${chart}" | |
cp src/LICENSE.md src/${chart}/ | |
helm dep up "src/${chart}" | |
helm package "src/${chart}" -u -d dest | |
done | |
- name: Push New Files | |
shell: bash | |
working-directory: dest | |
run: | | |
set -e | |
helm repo index . --url "${{ env.HELM_REPO_URL }}" | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
git add $(git ls-files -o --exclude-standard) | |
git add index.yaml | |
git commit -m "Updated from ref: $GITHUB_SHA" | |
git push |