Skip to content

Commit

Permalink
Fix #284: Update pipeline to publish to artifactory. (#285)
Browse files Browse the repository at this point in the history
* Fix #284: Update pipeline to publish to artifactory.

Co-authored-by: Martin Korbel <[email protected]>

---------

Co-authored-by: Martin Korbel <[email protected]>
  • Loading branch information
zcgandcomp and korbelm authored Jul 8, 2024
1 parent b71d748 commit 78d4624
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ on:
- 'develop'
- 'master'
- 'releases/*'
inputs:
push_to_acr:
description: Push to ACR?
type: boolean
default: true
push_to_jfrog:
description: Push to JFrog?
type: boolean
default: false
pull_request:
branches:
- 'develop'
Expand Down Expand Up @@ -46,20 +55,33 @@ jobs:
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Log in to JFrog registry
if: inputs.push_to_jfrog == true
uses: docker/login-action@v3
with:
registry: https://wultra.jfrog.io/
username: ${{ vars.JFROG_CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.JFROG_CONTAINER_REGISTRY_PASSWORD }}
- name: Log in to Azure registry
if: ${{ github.event_name == 'workflow_dispatch' }}
if: inputs.push_to_acr == true
uses: docker/login-action@v3
with:
registry: https://powerauth.azurecr.io/
username: ${{ secrets.ACR_USERNAME }}
username: ${{ vars.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Build and push container image to Azure registry
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name == 'workflow_dispatch' }}
platforms: linux/amd64
tags: powerauth.azurecr.io/mobile-utility-server:${{ env.REVISION }}${{ env.TIMESTAMP }}-${{ github.sha }}
push: ${{ inputs.push_to_acr == true || inputs.push_to_jfrog == true }}
platforms: linux/amd64,linux/arm64
tags: |
${{ inputs.push_to_acr == true && format('powerauth.azurecr.io/mobile-utility-server:{0}{1}-{2}', env.REVISION, env.TIMESTAMP, github.sha) || '' }}
${{ inputs.push_to_jfrog == true && format('wultra.jfrog.io/wultra-docker/mobile-utility-server:{0}{1}-{2}', env.REVISION, env.TIMESTAMP, github.sha) || '' }}
file: ./deploy/dockerfile/runtime/Dockerfile
context: .

- run: echo '### 🚀 Published images' >> $GITHUB_STEP_SUMMARY
- if: inputs.push_to_acr == true
run: |
echo 'powerauth.azurecr.io/mobile-utility-server:${{ env.REVISION }}${{ env.TIMESTAMP }}-${{ github.sha }}' >> $GITHUB_STEP_SUMMARY
- if: inputs.push_to_jfrog == true
run: echo 'wultra.jfrog.io/wultra-docker/mobile-utility-server:${{ env.REVISION }}${{ env.TIMESTAMP }}-${{ github.sha }}' >> $GITHUB_STEP_SUMMARY

0 comments on commit 78d4624

Please sign in to comment.