-
Notifications
You must be signed in to change notification settings - Fork 51
44 lines (42 loc) · 1.31 KB
/
release.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
name: Release Charts
on:
push:
branches:
- main
# paths:
# - 'charts/**'
jobs:
# Generate the values for charts with changes
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- id: files
uses: tj-actions/changed-files@v41
- name: Generate Matrix Content
id: generate-matrix
run: |
changed=`echo "${{ steps.files.outputs.all_changed_files }}" | sed 's/ /\n/g' | grep charts | cut -f2 -d'/' | uniq | sed 's/^/"/;s/$/"/' | sed -z 's/\n/,/g;s/,$/\n/'`
echo "::set-output name=matrix::{ \"chart\": [ ${changed} ] }"
chart-release:
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Push Helm Chart to dockerhub
uses: bsord/[email protected]
with:
useOCIRegistry: true
registry-url: oci://registry-1.docker.io/gradiant
username: ${{ secrets.OCI_USERNAME }}
password: ${{ secrets.OCI_PASSWORD }}
force: true
chart-folder: charts/${{ matrix.chart }}