diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml index fb767e2..83ccbbb 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-docker-image.yml @@ -54,14 +54,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: "powerauth-${{ matrix.app }} ${{ inputs.version }}: Build and push docker image to Azure registry (if enabled)" - uses: docker/build-push-action@v5 - with: - push: false - platforms: linux/amd64,linux/arm64 - tags: powerauth.azurecr.io/${{matrix.app}}:${{ inputs.version }} - file: ./docker-powerauth-${{matrix.app}}/Dockerfile - context: . - name: Log in to Azure registry if: inputs.push_to_acr == true uses: docker/login-action@v3 @@ -69,69 +61,61 @@ jobs: registry: https://powerauth.azurecr.io/ username: ${{ secrets.ACR_USERNAME }} password: ${{ secrets.ACR_PASSWORD }} - - name: Push image to ACR registry - if: inputs.push_to_acr == true - run: | - docker buildx imagetools create \ - --tag powerauth.azurecr.io/${{matrix.app}}:${{ inputs.version }} \ - powerauth.azurecr.io/${{matrix.app}}:${{ inputs.version }} - name: Log in to Docker hub registry if: inputs.push_to_docker_hub == true uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - - name: Push image to Docker HUB registry - if: inputs.push_to_docker_hub == true - run: | - docker buildx imagetools create \ - --tag powerauth/${{matrix.app}}:${{ inputs.version }} \ - --tag powerauth/${{matrix.app}}:latest \ - powerauth.azurecr.io/${{matrix.app}}:${{ inputs.version }} - build-psql: - name: postgresql image - strategy: - matrix: - app: ["server","push","webflow",] - runs-on: 'ubuntu-latest' - environment: docker-publish - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: "powerauth-${{ matrix.app }}-postgresql: Build docker image" + - name: "powerauth-${{ matrix.app }} ${{ inputs.version }}: Build and push docker image to Azure registry (if enabled)" uses: docker/build-push-action@v5 with: - push: false - platforms: linux/amd64,linux/arm64 - tags: powerauth.azurecr.io/${{matrix.app}}-postgresql:${{ inputs.version }} - file: ./docker-powerauth-${{matrix.app}}-postgresql/Dockerfile + push: ${{ inputs.push_to_acr == true || inputs.push_to_docker_hub == true }} context: . - - name: Log in to Azure registry - if: inputs.push_to_acr == true - uses: docker/login-action@v3 - with: - registry: https://powerauth.azurecr.io/ - username: ${{ secrets.ACR_USERNAME }} - password: ${{ secrets.ACR_PASSWORD }} - - name: Push image to ACR - if: inputs.push_to_acr == true - run: | - docker buildx imagetools create \ - --tag powerauth.azurecr.io/${{matrix.app}}-postgresql:${{ inputs.version }} \ - powerauth.azurecr.io/${{matrix.app}}-postgresql:${{ inputs.version }} - - name: Log in to Docker hub registry - if: inputs.push_to_docker_hub == true - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} - - name: Push image to Docker HUB registry - if: inputs.push_to_docker_hub == true - run: | - docker buildx imagetools create \ - --tag powerauth/${{matrix.app}}-postgresql:${{ inputs.version }} \ - --tag powerauth/${{matrix.app}}-postgresql:latest \ - powerauth.azurecr.io/${{matrix.app}}-postgresql:${{ inputs.version }} + platforms: linux/amd64,linux/arm64 + file: ./docker-powerauth-${{matrix.app}}/Dockerfile + tags: "${{ inputs.push_to_acr == true && format('- powerauth.azurecr.io/{0}:{1}', matrix.app, inputs.version) || '' }} + ${{ inputs.push_to_acr == true && format('- powerauth/{0}:{1}', matrix.app, inputs.version) || '' }} + ${{ inputs.push_to_acr == true && format('- powerauth/{0}:latest', matrix.app) || '' }}" +# tags: | +# - powerauth.azurecr.io/${{matrix.app}}:${{ inputs.version }} +# - powerauth/${{matrix.app}}:${{ inputs.version }} +# - powerauth/${{matrix.app}}:latest +# build-psql: +# name: postgresql image +# strategy: +# matrix: +# app: ["server","push","webflow",] +# runs-on: 'ubuntu-latest' +# environment: docker-publish +# steps: +# - uses: actions/checkout@v4 +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v3 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# - name: Log in to Azure registry +# if: inputs.push_to_acr == true +# uses: docker/login-action@v3 +# with: +# registry: https://powerauth.azurecr.io/ +# username: ${{ secrets.ACR_USERNAME }} +# password: ${{ secrets.ACR_PASSWORD }} +# - name: Log in to Docker hub registry +# if: inputs.push_to_docker_hub == true +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKER_HUB_USERNAME }} +# password: ${{ secrets.DOCKER_HUB_PASSWORD }} +# - name: "powerauth-${{ matrix.app }}-postgresql: Build docker image" +# uses: docker/build-push-action@v5 +# with: +# push: ${{ inputs.push_to_acr == true || inputs.push_to_docker_hub == true }} +# context: . +# platforms: linux/amd64,linux/arm64 +# file: ./docker-powerauth-${{matrix.app}}-postgresql/Dockerfile +# tags: | +# - powerauth.azurecr.io/${{matrix.app}}-postgresql:${{ inputs.version }} +# - powerauth/${{matrix.app}}-postgresql:${{ inputs.version }} +# - powerauth/${{matrix.app}}-postgresql:latest +