diff --git a/.github/workflows/publish_image_chart.yaml b/.github/workflows/publish_image_chart.yaml index f3b91c9d45..43db24945c 100644 --- a/.github/workflows/publish_image_chart.yaml +++ b/.github/workflows/publish_image_chart.yaml @@ -97,6 +97,22 @@ jobs: cache-from: type=registry,ref=${{ matrix.container_registry }}/${{ matrix.image }}:latest cache-to: type=inline + # Publish Helm charts once, only after every image in the artifacts matrix has + # been pushed. This keeps charts from being published before their images exist, + # avoids concurrent duplicate pushes, and blocks the publish if a build fails. + charts: + runs-on: ubuntu-24.04 + needs: artifacts + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + - name: Determine version + run: echo "PIPECD_VERSION=$(git describe --tags --always --abbrev=7 --match 'v[0-9]*.*')" >> $GITHUB_ENV + # Building and pushing Helm charts. - name: Install helm uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 @@ -116,7 +132,7 @@ jobs: trigger-event-watcher: runs-on: ubuntu-24.04 - needs: artifacts + needs: charts steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -138,7 +154,7 @@ jobs: release-quickstart-manifests: runs-on: ubuntu-24.04 - needs: artifacts + needs: charts # ignore release candidates if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-rc') permissions: