Build and deploy docker image #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy docker image | |
on: | |
workflow_dispatch: | |
branches: | |
- 'develop' | |
- 'master' | |
- 'releases/*' | |
inputs: | |
version: | |
description: Application release version e.g. 1.0.0 | |
type: string | |
required: true | |
push_to_acr: | |
description: Push to Azure registry? | |
type: boolean | |
default: false | |
jobs: | |
build-app: | |
name: Build docker image for APP | |
strategy: | |
matrix: | |
app: ["server","data-adapter","nextstep","push-server","webflow","tpp-engine"] | |
runs-on: 'ubuntu-latest' | |
environment: docker-publish | |
env: | |
# these are global secrets - for readonly access to artifactory | |
INTERNAL_USERNAME: ${{ secrets.JFROG_USERNAME }} | |
INTERNAL_PASSWORD: ${{ secrets.JFROG_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare Libs | |
run: | | |
wget --no-verbose https://download.oracle.com/otn-pub/otn_software/jdbc/233/ojdbc11.jar -O ${GITHUB_WORKSPACE}/deploy/lib/ojdbc11.jar | |
wget --no-verbose https://jdbc.postgresql.org/download/postgresql-42.7.1.jar -O ${GITHUB_WORKSPACE}/deploy/lib/postgresql.jar | |
- name: Get Powerauth Server WAR files | |
if: matrix.app == 'server' | |
run: | | |
wget --no-verbose https://${{ env.INTERNAL_USERNAME }}:${{ env.INTERNAL_PASSWORD }}@wultra.jfrog.io/artifactory/internal-maven-repository/io/getlime/security/powerauth-admin/${{ inputs.version }}/powerauth-admin-${{ inputs.version }}.war -O ${GITHUB_WORKSPACE}/deploy/images/powerauth-admin.war | |
wget --no-verbose https://${{ env.INTERNAL_USERNAME }}:${{ env.INTERNAL_PASSWORD }}@wultra.jfrog.io/artifactory/internal-maven-repository/io/getlime/security/powerauth-java-server/${{ inputs.version }}/powerauth-java-server-${{ inputs.version }}.war -O ${GITHUB_WORKSPACE}/deploy/images/powerauth-java-server.war | |
- name: Get Powerauth ${{ matrix.app }} WAR file | |
if: matrix.app != 'server' | |
run: | | |
wget --no-verbose https://${{ env.INTERNAL_USERNAME }}:${{ env.INTERNAL_PASSWORD }}@wultra.jfrog.io/artifactory/internal-maven-repository/io/getlime/security/powerauth-${{ matrix.app }}/${{ inputs.version }}/powerauth-${{ matrix.app }}-${{ inputs.version }}.war -O ${GITHUB_WORKSPACE}/deploy/images/powerauth-${{ matrix.app }}.war | |
- 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 }} | |
uses: docker/login-action@v3 | |
with: | |
registry: https://powerauth.azurecr.io/ | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
- 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 }} | |
platforms: linux/amd64,linux/arm64 | |
tags: powerauth.azurecr.io/${{matrix.app}}:${{ inputs.version }} | |
file: ./docker-powerauth-${{matrix.app}}/Dockerfile | |
context: . | |
build-psql: | |
name: Build docker image for postgresql | |
strategy: | |
matrix: | |
app: ["server","push-server","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 }} | |
uses: docker/login-action@v3 | |
with: | |
registry: https://powerauth.azurecr.io/ | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
- name: "powerauth-${{ matrix.app }}-postgresql: Build and push docker image to Azure registry (if enabled)" | |
uses: docker/build-push-action@v5 | |
with: | |
push: ${{ inputs.push_to_acr }} | |
platforms: linux/amd64,linux/arm64 | |
tags: powerauth.azurecr.io/${{matrix.app}}-postgresql:${{ inputs.version }} | |
file: ./docker-powerauth-${{matrix.app}}-postgresql/Dockerfile | |
context: . |