Skip to content

Docker changes

Docker changes #9

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
java-package: jdk
architecture: x64
cache: maven
- name: Build with Maven
run: mvn clean package -Dmaven.test.skip=true
- name: Print Docker Hub Username
run: echo "vivek081141"
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: "vivek081141"
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/my-springboot-mongo-app:latest
- name: Log out from Docker Hub
run: docker logout