Skip to content

Commit

Permalink
Update CI.yml with original docker action
Browse files Browse the repository at this point in the history
  • Loading branch information
anosh-ar authored Jun 14, 2024
1 parent 4d84063 commit dbbb4aa
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,30 @@ jobs:
- name: Build with Gradle
run: ./gradlew build

- name: Build & push Docker image
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: anoshrz/java_project
tags: latest
registry: docker.io
dockerfile: Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

docker:
needs: build
runs-on: ubuntu-latest

steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: anoshrz/java_project:latest

- name: Log out from Docker Hub
run: docker logout
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
#
Expand Down

0 comments on commit dbbb4aa

Please sign in to comment.