-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.4 KB
/
release.yaml
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
name: Release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
name: Create Release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: v3.12.0
- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Helm login
run: |
echo -n '${{ secrets.OSC_REGISTRY_ROBOT_WEBSERVICES_TOKEN }}' | helm registry login docker-registry.osc.edu -u '${{ secrets.OSC_REGISTRY_ROBOT_WEBSERVICES_USERNAME }}' --password-stdin
- name: Publish private Helm charts
run: |
for chart in $(find charts-private -maxdepth 1 -mindepth 1 -type d); do
name=$(basename $chart)
version=$(helm show chart $chart | grep "^version:" | awk '{ print $2 }')
released_version=$(helm show chart oci://docker-registry.osc.edu/webservices/${name} 2>&1 | grep "^version:" | awk '{ print $2 }')
if [ "$version" == "$released_version" ]; then
echo "Chart ${name} already pushed, skipping"
continue
fi
helm package $chart -u
package=${name}-${version}.tgz
helm push $package oci://docker-registry.osc.edu/webservices
done