-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (85 loc) · 3.39 KB
/
develop_pa-test-internal-testserver-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy container app to Container Registries
on:
push:
branches:
- develop
workflow_dispatch:
inputs:
jfrog_deploy:
type: boolean
description: Check if build image should be uploaded to JFrog
default: false
required: false
jobs:
build:
runs-on: 'ubuntu-latest'
environment: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
server-id: jfrog-central
server-username: INTERNAL_USERNAME
server-password: INTERNAL_PASSWORD
cache: maven
- name: Set Timestamp for docker image for development branch
if: github.ref == 'refs/heads/develop'
run: echo "TIMESTAMP=-$(date +%Y.%m.%d)" >> $GITHUB_ENV
- name: Get Powerauth Test Server version
run: |
cd powerauth-test-server
REVISION=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`
echo "REVISION=$REVISION" >> $GITHUB_ENV
- name: Package test server war
run: |
cd powerauth-test-server
mvn package -DuseInternalRepo=true
env:
# those are not environmental secrect, but global secret - for readonly access to artifactory
INTERNAL_USERNAME: ${{ secrets.JFROG_USERNAME }}
INTERNAL_PASSWORD: ${{ secrets.JFROG_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to ACR
if: ${{ github.actor != 'dependabot[bot]' }}
uses: docker/login-action@v3
with:
registry: https://powerauthextendedtest.azurecr.io/
username: ${{ secrets.AZUREAPPSERVICE_CONTAINERUSERNAME }}
password: ${{ secrets.AZUREAPPSERVICE_CONTAINERPASSWORD }}
- name: Copy liquibase files
run: |
cd powerauth-test-server
./copy_liquibase.sh
- name: Build and push container image to ACR
uses: docker/build-push-action@v6
with:
push: ${{ github.actor != 'dependabot[bot]' }}
platforms: linux/amd64,linux/arm64
tags: powerauthextendedtest.azurecr.io/powerauth-test-server:${{ env.REVISION }}${{ env.TIMESTAMP }}-${{ github.sha }}
file: ./powerauth-test-server/Dockerfile
context: ./powerauth-test-server/
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Log in to JFrog
if: ${{ github.event_name == 'workflow_dispatch' && inputs.jfrog_deploy == true }}
uses: docker/login-action@v3
with:
registry: https://wultra.jfrog.io/
username: ${{ secrets.JFROG_CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.JFROG_CONTAINER_REGISTRY_PASSWORD }}
- name: Build and push container image to JFrog
if: ${{ github.event_name == 'workflow_dispatch' && inputs.jfrog_deploy == true }}
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name == 'workflow_dispatch' && inputs.jfrog_deploy == true }}
platforms: linux/amd64,linux/arm64
tags: wultra.jfrog.io/wultra-docker/powerauth-test-server:${{ env.REVISION }}${{ env.TIMESTAMP }}
file: ./powerauth-test-server/Dockerfile
context: ./powerauth-test-server/
cache-from: type=gha
cache-to: type=gha,mode=max