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 6a95a66
Showing 1 changed file with 50 additions and 65 deletions.
115 changes: 50 additions & 65 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,84 +54,69 @@ 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 }}
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

0 comments on commit 6a95a66

Please sign in to comment.