Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add ghcr oci image workflow #1

add ghcr oci image workflow

add ghcr oci image workflow #1

Workflow file for this run

# File: .github/workflows/publish-helm.yaml
name: Publish Helm Chart to GHCR
on:
push:
branches:
- main
permissions:
contents: read
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.14.0
- name: Install yq
uses: mikefarah/[email protected]
- name: Read chart version
id: chart
run: |
echo "version=$(yq -r '.version' Chart.yaml)" >> $GITHUB_OUTPUT
- name: Log in to GitHub Container Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io \
--username "${{ github.actor }}" --password-stdin
- name: Package & Push chart
run: |
# Package the chart from repo root (where Chart.yaml lives)
helm package . --destination .
# Push to GHCR under oc-community
TARBALL="oc-community-${{ steps.chart.outputs.version }}.tgz"
helm push "$TARBALL" oci://ghcr.io/${{ github.repository }}/oc-community