-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (72 loc) · 2.39 KB
/
publish-docker-image.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
name: Build and deploy docker image
on:
workflow_dispatch:
branches:
- 'develop'
- 'main'
- 'releases/*'
pull_request:
branches:
- 'develop'
- 'main'
- 'releases/*'
jobs:
build:
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@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: jfrog-central
server-username: INTERNAL_USERNAME
server-password: INTERNAL_PASSWORD
- name: Get User Data Store version
run: |
REVISION=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`
echo "REVISION=$REVISION" >> $GITHUB_ENV
- name: Build war
run: |
mvn package
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Log in to JFrog registry
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v2
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 registry
uses: docker/build-push-action@v3
with:
push: ${{ github.event_name == 'workflow_dispatch' }}
platforms: linux/amd64,linux/arm64
tags: wultra.jfrog.io/wultra-docker/user-data-store:${{ env.REVISION }}
file: ./Dockerfile
context: .
- name: Log in to Azure registry
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v2
with:
registry: https://powerauth.azurecr.io/
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Build and push container image to Azure registry
uses: docker/build-push-action@v3
with:
push: ${{ github.event_name == 'workflow_dispatch' }}
platforms: linux/amd64
tags: powerauth.azurecr.io/user-data-store:${{ env.REVISION }}-${{ github.sha }}
file: ./Dockerfile
context: .