Skip to content

Commit

Permalink
fix workflow to push to docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
Dert1129 committed Feb 19, 2024
1 parent e69ef5d commit e7b3e9e
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/build-gradle-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:

jobs:
build-gradle-project:
env:
IMAGE_TAG: 1.1
runs-on: ubuntu-latest
steps:
- name: Get branch names
Expand Down Expand Up @@ -34,5 +36,18 @@ jobs:

- name: Run build with Gradle Wrapper
run: |
./gradlew build docker
docker push "kingstonduo/hydra-data:${{ steps.branch-names.outputs.current_branch }}"
./gradlew build docker
- name: Push to Docker Hub if branch is develop
if: steps.branch-names.outputs.current_branch == 'develop'
run: |
docker push "kingstonduo/hydra-data:$IMAGE_TAG"
- name: Push to Docker Hub if branch is not develop
if: ${{ !steps.branch-names.outputs.current_branch == 'develop' }}
run: |
docker push "kingstonduo/hydra-data:${{ steps.branch-names.outputs.current_branch }}"

0 comments on commit e7b3e9e

Please sign in to comment.