feat(charts): deploy all #6
Workflow file for this run
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: | |
| pull_request: | |
| branches: ["master"] | |
| paths: ["charts/**/metadata.yaml"] | |
| push: | |
| branches: ["master"] | |
| paths: ["charts/**/metadata.yaml"] | |
| workflow_dispatch: | |
| inputs: | |
| chart: | |
| description: Chart to release | |
| required: true | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| jobs: | |
| changed-files: | |
| name: Get Changed Files | |
| runs-on: ubuntu-latest | |
| outputs: | |
| charts: ${{ steps.charts.outputs.charts }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - if: ${{ github.event_name != 'workflow_dispatch' }} | |
| name: Get Changed Files | |
| id: changed-files | |
| uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46 | |
| with: | |
| files: charts/**/metadata.yaml | |
| - name: Extract Chart values | |
| id: charts | |
| run: | | |
| if [[ "${{ github.event_name }}" != "workflow_dispatch" ]]; then | |
| charts="${{ steps.changed-files.outputs.all_changed_and_modified_files }}" | |
| else | |
| charts="charts/${{ inputs.chart }}/metadata.yaml" | |
| fi | |
| charts=$(yq eval-all --indent=0 --output-format=json "[.]" $charts) | |
| echo "charts=${charts}" >> $GITHUB_OUTPUT | |
| push-charts: | |
| needs: changed-files | |
| name: Push Charts | |
| runs-on: ubuntu-latest | |
| if: ${{ needs.changed-files.outputs.charts != '[]' }} | |
| strategy: | |
| matrix: | |
| charts: ${{ fromJSON(needs.changed-files.outputs.charts) }} | |
| max-parallel: 4 | |
| fail-fast: false | |
| steps: | |
| - name: Install Helm | |
| uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4 | |
| - if: ${{ github.event_name != 'pull_request' }} | |
| name: Install Cosign | |
| uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3 | |
| - if: ${{ github.event_name != 'pull_request' }} | |
| name: Login to GitHub Container Registry | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| - name: Add Helm Repository | |
| run: helm repo add upstream ${{ matrix.charts.registry }} | |
| - name: Update Helm Repository | |
| run: helm repo update upstream | |
| - name: Pull Chart | |
| run: helm pull upstream/${{ matrix.charts.chart }} --version ${{ matrix.charts.version }} | |
| - if: ${{ github.event_name != 'pull_request' }} | |
| name: Push Chart | |
| run: helm push *.tgz oci://ghcr.io/${{ github.repository }} | |
| - if: ${{ github.event_name != 'pull_request' }} | |
| name: Sign artifacts with Cosign | |
| run: cosign sign --yes ghcr.io/${{ github.repository }}/${{ matrix.charts.chart }}:${{ matrix.charts.version }} |