Skip to content

Commit

Permalink
feat: split up workflow in multiple parts
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Oct 14, 2024
1 parent 80da8b1 commit 356e6d1
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,39 @@ 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 }}
password: ${{ secrets.GITHUB_TOKEN }}

- 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
Expand All @@ -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 "[email protected]"
- 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/[email protected]
if: ${{ steps.release.outputs.release_created == 'true' }}
if: ${{ needs.release-please.outputs.release_created }}
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 comments on commit 356e6d1

Please sign in to comment.