Skip to content

Commit

Permalink
add github workflow for notification-service
Browse files Browse the repository at this point in the history
  • Loading branch information
azdanov committed May 3, 2024
1 parent 1349410 commit 8c5eb6e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/notification-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Notification Service
on:
push:
paths:
- notification-service/**
branches:
- '**'
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
working-directory: ./notification-service
DOCKER_IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/bookstore-notification-service
defaults:
run:
working-directory: ${{ env.working-directory }}
steps:
- uses: actions/checkout@v4
- name: Setup Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: ./mvnw -ntp verify
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Publish Docker Image
run: |
./mvnw spring-boot:build-image -DskipTests
echo "Pushing the image $DOCKER_IMAGE_NAME to Docker Hub."
docker push $DOCKER_IMAGE_NAME

0 comments on commit 8c5eb6e

Please sign in to comment.