Update java_prod_app.service #353
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | |
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | |
POSTGRES_DB: ${{ secrets.POSTGRES_DB }} | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 10s | |
--health-retries 5 | |
rabbitmq: | |
image: rabbitmq:3-management | |
env: | |
RABBITMQ_DEFAULT_USER: ${{ secrets.RABBITMQ_USER }} | |
RABBITMQ_DEFAULT_PASS: ${{ secrets.RABBITMQ_PASSWORD }} | |
ports: | |
- 5672:5672 | |
- 15672:15672 | |
options: >- | |
--health-cmd "rabbitmqctl node_health_check" | |
--health-interval 10s | |
--health-timeout 10s | |
--health-retries 5 | |
env: | |
MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" | |
steps: | |
- name: Checkout repository base | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: maven | |
- name: Create application.properties | |
run: | | |
echo "spring.profiles.active=ci" > src/main/resources/application.properties | |
echo "${{ secrets.APPLICATION_PROPERTIES }}" | base64 --decode > src/main/resources/application-ci.properties | |
- name: Build the application | |
run: mvn verify -B | |
- name: Start Application | |
run: java -jar target/hng-java-boilerplate-0.0.1-SNAPSHOT.jar & sleep 15 |