Skip to content

dockerized catalog-service #6

dockerized catalog-service

dockerized catalog-service #6

name: Catalog Service

Check failure on line 1 in .github/workflows/catalog-service.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/catalog-service.yml

Invalid workflow file

(Line: 32, Col: 13): A mapping was not expected, (Line: 39, Col: 13): A mapping was not expected
on:
push:
paths:
- catalog-service/**
branches:
- '**'
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
working-directory: ./catalog-service
defaults:
run:
working-directory: ${{ env.working-directory }}
steps:
- uses: actions/checkout@v4
- name: Setup Java 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build with Maven
run: ./mvnw -ntp verify
- if: {{github.ref == 'refs/heads/main'}}
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- if: {{github.ref == 'refs/heads/main'}}
name: Build and Push Docker Image
run: |
./mvnw -ntp spring-boot:build-image -DSkipTests
docker push ${{secrets.DOCKERHUB_USERNAME}}/bookstore-catalog-service:latest