-
Notifications
You must be signed in to change notification settings - Fork 10
53 lines (42 loc) · 1.29 KB
/
publish-chart-as-oci-image.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
53
name: Publish Helm Chart as OCI Image
on:
workflow_dispatch:
push:
branches:
- improved-helm-chart-deployment
permissions:
contents: read
packages: write
jobs:
publish-helm-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Cache Helm dependencies
uses: actions/cache@v4
with:
path: ~/.cache/helm
key: ${{ runner.os }}-helm-${{ hashFiles('keycloak-chart/Chart.lock') }}
restore-keys: |
${{ runner.os }}-helm-
- name: Helm lint
run: helm lint ./keycloak-chart
- name: Package Helm Charts
run: |
helm package ./keycloak-chart && mv keycloak-chart*.tgz ocr-keycloak.tgz
- name: Login to GitHub Container Registry
uses: docker/#-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Helm Charts to GitHub Container Registry (GHCR)
run: |
CHART_REPO="ghcr.io/${{ github.repository }}"
helm push ./ocr-keycloak.tgz oci://$CHART_REPO/keycloak
- name: Clean up temporary files
run: |
rm -f ocr-*.tgz