update gh action helm push oci #120
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |