Skip to content

Commit

Permalink
enable chart push to ghcr as oci artifact (#523)
Browse files Browse the repository at this point in the history
Signed-off-by: ishuar <[email protected]>
  • Loading branch information
ishuar authored Dec 7, 2023
1 parent e0de1c3 commit 5702849
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@ on:
branches:
- main

permissions:
contents: write
packages: write ## needed for ghcr access

jobs:
release:
if: github.repository == 'vmware-tanzu/helm-charts'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 3.13.2

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
Expand All @@ -24,3 +33,20 @@ jobs:
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Charts to GHCR
run: |
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts
done

0 comments on commit 5702849

Please sign in to comment.