Make envVar format Secret and ConfigMap keys optional (#24) #7
This file contains hidden or 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 | |
| tags: | |
| - '*' | |
| jobs: | |
| release-docker: | |
| runs-on: ubuntu-latest | |
| name: Release Docker | |
| steps: | |
| - name: Set version | |
| run: | | |
| ref=${GITHUB_REF#refs/*/} | |
| if [ $ref = "main" ]; then | |
| version="latest" | |
| else | |
| version=$ref | |
| fi | |
| echo "REF=${ref}" >> $GITHUB_ENV | |
| echo "VERSION=${version}" >> $GITHUB_ENV | |
| - uses: actions/checkout@v6 | |
| - uses: docker/setup-qemu-action@v4 | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.OSC_ROBOT_DOCKERHUB_USER }} | |
| password: ${{ secrets.OSC_ROBOT_DOCKERHUB_TOKEN }} | |
| - name: Login to quay.io | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_USERNAME }} | |
| password: ${{ secrets.QUAY_ACCESS_TOKEN }} | |
| - name: Build and push | |
| id: docker_build | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ohiosupercomputer/keycloak-cr-operator:${{ env.VERSION }},quay.io/ohiosupercomputercenter/keycloak-cr-operator:${{ env.VERSION }} | |
| - name: Image digest | |
| run: echo ${{ steps.docker_build.outputs.digest }} | |
| release: | |
| runs-on: ubuntu-latest | |
| name: Create Release | |
| needs: [release-docker] | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Set version | |
| run: | | |
| TAG="${GITHUB_REF#refs/*/}" | |
| echo "TAG=$TAG" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: v4.1.1 | |
| - name: Verify version | |
| run: | | |
| if yq e ".version == strenv(TAG)" charts/keycloak-cr-operator/Chart.yaml; then | |
| echo "Chart version matches" | |
| else | |
| echo "Tag $TAG does not match Chart.yaml version" | |
| exit 1 | |
| fi | |
| if yq e ".appVersion == strenv(TAG)" charts/keycloak-cr-operator/Chart.yaml; then | |
| echo "Chart appVersion matches" | |
| else | |
| echo "Tag $TAG does not match Chart.yaml appVersion" | |
| exit 1 | |
| fi | |
| - name: Publish Helm charts | |
| uses: stefanprodan/helm-gh-pages@master | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} |