trigger-release #220
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: | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [trigger-release] | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| - name: Run chart-releaser | |
| uses: helm/chart-releaser-action@v1.5.0 | |
| env: | |
| CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| with: | |
| charts_dir: . | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4.1.0 | |
| with: | |
| version: "3.19.2" | |
| - name: Install yq | |
| run: sudo apt-get update && sudo apt-get install -y yq | |
| - name: Package Helm chart | |
| run: helm package mirrord-operator | |
| - name: Log in to GitHub Container Registry (manual dispatch) | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| run: echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Log in to GitHub Container Registry (remote trigger) | |
| if: ${{ github.event_name == 'repository_dispatch' }} | |
| run: echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u ${{ github.event.client_payload.actor }} --password-stdin | |
| - name: Push Helm chart to GHCR | |
| run: | | |
| CHART_VERSION=$(yq -r '.version' mirrord-operator/Chart.yaml) | |
| helm push mirrord-operator-${CHART_VERSION}.tgz oci://ghcr.io/${{ github.repository_owner }} | |
| - name: Package License Server Helm chart | |
| run: helm package mirrord-license-server | |
| - name: Push License Server Helm chart to GHCR | |
| run: | | |
| LICENSE_CHART_VERSION=$(yq -r '.version' mirrord-license-server/Chart.yaml) | |
| helm push mirrord-operator-license-server-${LICENSE_CHART_VERSION}.tgz oci://ghcr.io/${{ github.repository_owner }} |