-
Notifications
You must be signed in to change notification settings - Fork 11
153 lines (139 loc) · 5.05 KB
/
Copy pathoci-charts-ghcr.yaml
File metadata and controls
153 lines (139 loc) · 5.05 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Publish OCI Charts
on:
pull_request:
paths:
- "charts/**"
- ".github/workflows/oci-charts-ghcr.yaml"
push:
branches:
- master
paths:
- "charts/**"
permissions:
contents: read
packages: write
jobs:
publish-test:
name: Publish test charts
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: console
dir: charts/console
repository: pluralsh/test-charts
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: azure/setup-helm@v4
- name: Add repos
run: |
helm repo add vmware https://vmware-tanzu.github.io/helm-charts
helm repo add radar https://radar-base.github.io/radar-helm-charts
helm repo add fluxcd-community https://fluxcd-community.github.io/helm-charts
helm repo add dexidp https://charts.dexidp.io
- name: Push chart (0.0.0+pr-<number>)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
uses: appany/helm-oci-chart-releaser@v0.5.0
with:
name: ${{ matrix.name }}
repository: ${{ matrix.repository }}
tag: 0.0.0+test
path: ${{ matrix.dir }}
registry: ghcr.io
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
update_dependencies: "true"
publish:
name: Publish charts
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: console
dir: charts/console
repository: pluralsh/charts
- name: controller
dir: charts/controller
repository: pluralsh/controller-chart
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: azure/setup-helm@v4
- name: Add repos
run: |
helm repo add vmware https://vmware-tanzu.github.io/helm-charts
helm repo add radar https://radar-base.github.io/radar-helm-charts
helm repo add fluxcd-community https://fluxcd-community.github.io/helm-charts
helm repo add dexidp https://charts.dexidp.io
- name: PR tag values
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
id: pr_tags
run: |
echo "pr_tag=0.0.0+pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
echo "sha_tag=0.0.0+sha-${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
- name: Push chart (0.0.0+pr-<number>)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
uses: appany/helm-oci-chart-releaser@v0.5.0
with:
name: ${{ matrix.name }}
repository: ${{ matrix.repository }}
tag: ${{ steps.pr_tags.outputs.pr_tag }}
path: ${{ matrix.dir }}
registry: ghcr.io
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
update_dependencies: "true"
- name: Push chart (0.0.0+sha-<sha>)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
uses: appany/helm-oci-chart-releaser@v0.5.0
with:
name: ${{ matrix.name }}
repository: ${{ matrix.repository }}
tag: ${{ steps.pr_tags.outputs.sha_tag }}
path: ${{ matrix.dir }}
registry: ghcr.io
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
update_dependencies: "true"
- name: Chart version
if: ${{ github.ref == 'refs/heads/master' }}
id: chart_version
run: |
set -euo pipefail
version=$(awk -F': *' '/^version:/ {print $2; exit}' "${{ matrix.dir }}/Chart.yaml")
if [ -z "$version" ]; then
echo "Missing version in ${{ matrix.dir }}/Chart.yaml" >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Push chart (${{ steps.chart_version.outputs.version }})
if: ${{ github.ref == 'refs/heads/master' }}
uses: appany/helm-oci-chart-releaser@v0.5.0
with:
name: ${{ matrix.name }}
repository: ${{ matrix.repository }}
tag: ${{ steps.chart_version.outputs.version }}
path: ${{ matrix.dir }}
registry: ghcr.io
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
update_dependencies: "true"
- name: Push chart (${{ steps.chart_version.outputs.version }}+latest)
if: ${{ github.ref == 'refs/heads/master' }}
uses: appany/helm-oci-chart-releaser@v0.5.0
with:
name: ${{ matrix.name }}
repository: ${{ matrix.repository }}
tag: ${{ steps.chart_version.outputs.version }}+latest
path: ${{ matrix.dir }}
registry: ghcr.io
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
update_dependencies: "true"