Skip to content

Commit

Permalink
Fix multi registry pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
korbelm committed Apr 17, 2024
1 parent e14410f commit a308c45
Showing 1 changed file with 23 additions and 42 deletions.
65 changes: 23 additions & 42 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,40 +54,31 @@ 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
with:
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 }}
- name: "powerauth-${{ matrix.app }} ${{ inputs.version }}: Build and push docker image to Azure registry (if enabled)"
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}}/Dockerfile
tags: |
${{ inputs.push_to_acr == true && format('powerauth.azurecr.io/{0}:{1}', matrix.app, inputs.version) || '' }}
${{ inputs.push_to_docker_hub == true && format('powerauth/{0}:{1}', matrix.app, inputs.version) || '' }}
${{ inputs.push_to_docker_hub == true && format('powerauth/{0}:latest', matrix.app) || '' }}
build-psql:
name: postgresql image
strategy:
Expand All @@ -101,37 +92,27 @@ jobs:
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"
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
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 }}
- 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: |
${{ inputs.push_to_acr == true && format('powerauth.azurecr.io/{0}-postgresql:{1}', matrix.app, inputs.version) || '' }}
${{ inputs.push_to_docker_hub == true && format('powerauth/{0}-postgresql:{1}', matrix.app, inputs.version) || '' }}
${{ inputs.push_to_docker_hub == true && format('powerauth/{0}-postgresql:latest', matrix.app) || '' }}

0 comments on commit a308c45

Please sign in to comment.