Skip to content

Update maven.yml

Update maven.yml #73

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: HolaCMS31
on:
push:
branches: [ "holacms31" ]
jobs:
container-job:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_DB: holarse
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: '17'
cache: maven
distribution: 'temurin'
- name: Build and Test HolaCMS
run: mvn package
- name: Deploy Database
env:
# The hostname used to communicate with the PostgreSQL service container
DB_HOST: postgres
DB_NAME: holarse
DB_USER: postgres
DB_PASS: geheim
DB_PORT: 5432
run: "PGPASSWORD=${DB_PASSWORD} /usr/bin/psql -h ${DB_HOST} -p ${DB_PORT} -U ${DB_USER} -d ${DB_NAME}"