Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(misc): build docker images on demand #53

Merged
merged 6 commits into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/build-docker-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 }}
Loading