Skip to content

feat: initial commit #1

feat: initial commit

feat: initial commit #1

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build-and-push:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 23
- uses: gradle/actions/setup-gradle@v4
- name: Get release version
run: |
VERSION=${{ github.event.release.tag_name || 'develop' }}
# Remove the "v" prefix, if it exists
IMAGE_TAG=${VERSION#v}
echo "IMAGE_REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Build Docker Image with bootBuildImage
run: ./gradlew bootBuildImage --imageName=$IMAGE_REPOSITORY --Pversion=$IMAGE_TAG
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PAT }}
- name: Push Docker Image
run: docker push $IMAGE_TAG