-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (54 loc) · 2.06 KB
/
build-docker-images.yaml
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
---
name: Build docker images
on:
workflow_dispatch:
jobs:
container_build:
name: Build docker images and publish to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Get the current version
id: vars
run: |
git log -n 5
COMMIT_HASH_SHORT=$(git rev-parse --short HEAD)
echo $COMMIT_HASH_SHORT
CURRENT_VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)
echo $CURRENT_VERSION
DOCKER_IMAGE_TAG=$CURRENT_VERSION-$COMMIT_HASH_SHORT
echo "docker-image-tag=$DOCKER_IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build kraken-app-controller container
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/app-controller/Dockerfile
push: true
tags: cloudnexusopsdockerhub/kraken-app-controller:${{ steps.vars.outputs.docker-image-tag }}
- name: Build kraken-app-hub container
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/app-hub/Dockerfile
push: true
tags: cloudnexusopsdockerhub/kraken-app-hub:${{ steps.vars.outputs.docker-image-tag }}
- name: Build kraken-app-agent container
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/app-agent/Dockerfile
push: true
tags: cloudnexusopsdockerhub/kraken-app-agent:${{ steps.vars.outputs.docker-image-tag }}
- name: Build kraken-app-portal container
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/app-portal/Dockerfile
push: true
tags: cloudnexusopsdockerhub/kraken-app-portal:${{ steps.vars.outputs.docker-image-tag }}