Skip to content

build: Fix docker image tag issue #10

build: Fix docker image tag issue

build: Fix docker image tag issue #10

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 # Base image name
tags: |
latest # Pushes as 'vishwajeet29/learning-repo:latest'
${{ github.sha }} # Pushes as 'vishwajeet29/learning-repo:<commit SHA>'
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}