Skip to content
Open
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
49 changes: 49 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and Push Fineract Image

on:
push:
branches:
- main # build whenever you push to main
workflow_dispatch: # allow manual runs from the Actions tab

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image with Jib
run: |
IMAGE=ghcr.io/${{ github.repository }}/fineract

echo "Building image with commit SHA tag"
./gradlew :fineract-provider:jib \
-Djib.to.image=$IMAGE:${{ github.sha }}

echo "Also tagging as latest"
./gradlew :fineract-provider:jib \
-Djib.to.image=$IMAGE:latest
Loading