Skip to content

Merge pull request #150 from KPMP/KPMP-5618_add_enrollment_category #85

Merge pull request #150 from KPMP/KPMP-5618_add_enrollment_category

Merge pull request #150 from KPMP/KPMP-5618_add_enrollment_category #85

name: Build pegasus-data docker image
on:
push:
jobs:
build-gradle-project:
env:
IMAGE_TAG: 2.6.0
runs-on: ubuntu-latest
steps:
- name: Get branch names
id: branch-names
uses: tj-actions/branch-names@v8
- name: Get current branch name
if: steps.branch-names.outputs.is_default == 'false'
run: |
echo "Running on branch: ${{ steps.branch-names.outputs.current_branch }}"
- name: Checkout project sources
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.5
- name: Login to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.ENV_DOCKER_USER }}
password: ${{ secrets.ENV_DOCKER_PASS }}
- name: Run build with Gradle Wrapper
run: |
./gradlew build docker
- name: Push to Docker Hub if branch is develop
if: steps.branch-names.outputs.current_branch == 'develop'
run: |
docker push "kingstonduo/pegasus-data:${{env.IMAGE_TAG}}"
- name: Push to Docker Hub if branch is not develop
if: steps.branch-names.outputs.current_branch != 'develop'
run: |
docker push "kingstonduo/pegasus-data:${{ steps.branch-names.outputs.current_branch }}"