Skip to content

Docker changes

Docker changes #25

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 ${{ secrets.DOCKER_USERNAME }}
- 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@v2
with:
context: .
push: true
platforms: linux/arm64 # Mac M1 chip
tags: ${{ secrets.DOCKER_USERNAME }}/my-springboot-mongo-app:latest
- name: Log out from Docker Hub
run: docker logout