-
Notifications
You must be signed in to change notification settings - Fork 13
52 lines (49 loc) · 1.37 KB
/
push-oci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Push Helm Chart to OCI Registry
concurrency:
group: ci-${{ github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- main
- v[0-9]+
- v[0-9]+.[0-9]+
- cryostat-v[0-9]+.[0-9]+
workflow_dispatch:
jobs:
helm-push-to-OCI:
permissions:
packages: write
contents: write
runs-on: ubuntu-latest
if: github.repository_owner == 'cryostatio'
steps:
- 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: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.14.4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_PKGS_WRITE }}
- name: Patch chart name
run: yq -i ".name = \"${{ github.event.repository.name }}\"" ./charts/*/Chart.yaml
- name: Package charts
run: helm package ./charts/*
- name: Push charts to GHCR
run: |
for pkg in ./*.tgz; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" oci://ghcr.io/${{ github.repository_owner }}
done