Skip to content

build: Add docker build and push commands in workflow. #6

build: Add docker build and push commands in workflow.

build: Add docker build and push commands in workflow. #6

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '21'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Run tests
run: ./gradlew test
- name: Build and Push Docker Image
uses: mr-smithers-excellent/docker-build-push@v4
with:
image: vishwajeet29/learning-repo
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}