From 8db8d212850fdf42a4ae394eff99175e03c535b4 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Thu, 5 Oct 2023 13:07:41 +0300 Subject: [PATCH] fix(docker): moved docker release workflow under release workflow --- .github/workflows/release.yaml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6a8e0a58..7f1e5a7d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,8 +10,13 @@ permissions: name: release jobs: - release-please: + release_please: runs-on: ubuntu-latest + outputs: + major: ${{ steps.release.outputs.major }} + minor: ${{ steps.release.outputs.minor }} + patch: ${{ steps.release.outputs.patch }} + release_created: ${{ steps.release.outputs.release_created }} steps: - uses: google-github-actions/release-please-action@v3 id: release @@ -36,25 +41,30 @@ jobs: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} if: ${{ steps.release.outputs.release_created }} + publish_docker: + runs-on: ubuntu-latest + needs: release_please + if: ${{needs.release_please.outputs.release_created}} + steps: + - run: echo major ${{needs.release_please.outputs.major}} + - run: echo minor ${{needs.release_please.outputs.minor}} + - run: echo patch ${{needs.release_please.outputs.patch}} - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: platforms: 'arm64,arm' - if: ${{ steps.release.outputs.release_created }} - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 with: platforms: linux/arm64,linux/amd64,linux/arm/v7 - if: ${{ steps.release.outputs.release_created }} - name: Login to DockerHub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - if: ${{ steps.release.outputs.release_created }} - name: Login to GHCR uses: docker/login-action@v3 @@ -62,7 +72,6 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - if: ${{ steps.release.outputs.release_created }} - name: Build and push uses: docker/build-push-action@v5 @@ -71,7 +80,6 @@ jobs: platforms: ${{ steps.buildx.outputs.platforms }} push: true tags: | - type=semver,pattern={{steps.release.outputs.major}}.{{steps.release.outputs.minor}}.{{steps.release.outputs.patch}} - type=semver,pattern={{steps.release.outputs.major}}.{{steps.release.outputs.minor}} - type=semver,pattern={{steps.release.outputs.major}} - if: ${{ steps.release.outputs.release_created }} + ${{ github.repository }}:{{steps.release.outputs.major}}.{{steps.release.outputs.minor}}.{{steps.release.outputs.patch}} + ${{ github.repository }}:{{steps.release.outputs.major}}.{{steps.release.outputs.minor}} + ${{ github.repository }}:{{steps.release.outputs.major}}