Bump actions/setup-java from 2 to 4 #5
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: DCSA-TEMPLATE MASTER CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: DCSA-Project-Template | |
submodules: recursive | |
- name: Set up Java JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'maven' | |
- name: maven-settings-xml-action | |
uses: whelk-io/maven-settings-xml-action@v12 | |
with: | |
repositories: '[{ "id": "github", "name": "DCSA Backend repo", "url": "https://maven.pkg.github.com/dcsaorg/DCSA-Core", "releases": { "enabled": "true" }, "snapshots": { "enabled": "true" } }]' | |
servers: '[{ "id": "github", "username": "${{ secrets.DCSA_USER }}", "password": "${{ secrets.DCSA_PACKAGES_PAT }}" }]' | |
- name: Build Template | |
run: cd DCSA-Project-Template && mvn clean -U -B package -Ddcsa.artifacttype=-SNAPSHOT | |
- name: Build and run the microservices | |
run: cd DCSA-Project-Template && docker-compose -f docker-compose.yml --env-file=.github/.env up -d -V --build | |
- name: Fetch Backend Status | |
run: | | |
sleep 10 | |
status=$(curl -s http://localhost:9090/actuator/health | jq -r '.status') | |
retries=12 | |
while [[ "$status" != "UP" ]] && [[ $retries -gt 0 ]]; do | |
echo "Status is '$status' - waiting 5 secs ($retries retries left)" | |
sleep 5 | |
retries=$((retries - 1)) | |
status=$(curl -s http://localhost:9090/actuator/health | jq -r '.status') | |
done | |
echo "Final status is '$status'" | |
if [[ "$status" != "UP" ]]; then | |
curl -v http://localhost:9090/actuator/health || : | |
docker ps || : | |
docker logs dcsa-template_dcsa-template_1 || : | |
exit 1 | |
fi | |
echo "::set-output name=STATUS::$status" | |
id: healthcheck | |
- name: Confirm microservice status | |
if: ${{ steps.healthcheck.outputs.STATUS == 'UP' }} | |
run: | | |
echo "The DCSA-Project-Template service is UP." | |
# - name: Publish package | |
# run: cd DCSA-PROJECT-TEMPLATE && mvn -U -B deploy -DskipTests -Ddcsa.artifacttype=-SNAPSHOT | |
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} |