From 356e6d1b2d27c389fd8efdc850a97e046abd8579 Mon Sep 17 00:00:00 2001 From: Richard87 Date: Mon, 14 Oct 2024 12:23:54 +0200 Subject: [PATCH] feat: split up workflow in multiple parts --- .github/workflows/release-please.yaml | 37 +++++++++++++++++---------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 058a61d..6f1d04a 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -15,24 +15,29 @@ jobs: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} + outputs: + version: "${{steps.release.outputs.version }}" + release_created: "${{steps.release.outputs.release_created == 'true' }}" + steps: - uses: actions/checkout@v4 - - uses: googleapis/release-please-action@v4 id: release - - - run: echo "${{steps.release.outputs.release-created}}" - - run: echo "${{steps.release.outputs.release-created == 'true'}}" - - # Docker build + release-container: + runs-on: ubuntu-latest + needs: release-please + steps: + - run: echo "${{needs.release-please.outputs.version}}" + - run: echo "${{needs.release-please.outputs.release_created}}" + - uses: actions/checkout@v4 - name: Set up Docker Buildx - if: ${{ steps.release.outputs.release_created == 'true' }} + if: ${{ needs.release-please.outputs.release_created }} uses: docker/setup-buildx-action@v3 - name: Log in to the Container registry uses: docker/login-action@v3 - if: ${{ steps.release.outputs.release_created == 'true' }} + if: ${{ needs.release-please.outputs.release_created }} with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -40,9 +45,9 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v6 - if: ${{ steps.release.outputs.release_created == 'true' }} + if: ${{ needs.release-please.outputs.release_created }} env: - TAG: ${{ steps.release.outputs.version }} + TAG: ${{ needs.release-please.outputs.version }} with: context: . file: ./Dockerfile @@ -52,20 +57,24 @@ jobs: linux/amd64 linux/arm64 - # Helm Chart + release-helm: + runs-on: ubuntu-latest + needs: release-please + steps: + - uses: actions/checkout@v4 - name: Configure Git - if: ${{ steps.release.outputs.release_created == 'true' }} + if: ${{ needs.release-please.outputs.release_created }} run: | git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - name: Install Helm uses: azure/setup-helm@v4 - if: ${{ steps.release.outputs.release_created == 'true' }} + if: ${{ needs.release-please.outputs.release_created }} env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: Run chart-releaser uses: helm/chart-releaser-action@v1.6.0 - if: ${{ steps.release.outputs.release_created == 'true' }} + if: ${{ needs.release-please.outputs.release_created }} env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"