Fix paas-service-account-authorized-for-groups (#255) #252
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 | |
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 |