Skip to content

Version v1.1.3

Version v1.1.3 #4

Workflow file for this run

name: Publish Helm Chart to GHCR
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
required: true
jobs:
release:
if: ${{ github.event_name == "workflow_dispatch" || startsWith(github.event.release.tag_name, 'v') }}

Check failure on line 13 in .github/workflows/chart-publish.yml

View workflow run for this annotation

GitHub Actions / Publish Helm Chart to GHCR

Invalid workflow file

The workflow is not valid. .github/workflows/chart-publish.yml (Line: 13, Col: 9): Unexpected symbol: '"workflow_dispatch"'. Located at position 22 within expression: github.event_name == "workflow_dispatch" || startsWith(github.event.release.tag_name, 'v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Set Name and Version
run: |
CHART_NAME="osrd"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
CHART_VERSION="${{ github.event.inputs.tag_name }}"
else
CHART_VERSION="${{ github.event.release.tag_name }}"
fi
echo "CHART_NAME=$CHART_NAME" >> $GITHUB_ENV
echo "CHART_VERSION=$CHART_VERSION" >> $GITHUB_ENV
sed -i "s/NAME_REPLACE_ME/$CHART_NAME/" ./chart/Chart.yaml
sed -i "s/VERSION_REPLACE_ME/$CHART_VERSION/" ./chart/Chart.yaml
- name: Lint Helm Chart
run: helm lint ./chart
- name: Save and Push Helm Chart to GHCR
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
helm package ./chart
echo "Pushing to oci://ghcr.io/openrailassociation/${CHART_NAME}:${CHART_VERSION}"
helm push ${CHART_NAME}-${CHART_VERSION}.tgz oci://ghcr.io/openrailassociation/osrd-charts