fix(deps): update all non-major dependencies #1885
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: Build, Test and Deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CI_PROJECT_URL: ${{ github.github.server_url }}/${{ github.repository }} | |
CI_COMMIT_SHA: ${{ github.sha }} | |
MAVEN_CLI_OPTS: '--batch-mode --errors --fail-at-end --show-version' | |
jobs: | |
build-test-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: temurin | |
- name: Docker Login | |
uses: Azure/docker-login@v2 | |
with: | |
login-server: ghcr.io | |
username: ${{ secrets.GHCR_USERNAME }} | |
password: ${{ secrets.GHCR_PASSWORD }} | |
- name: Build application | |
run: mvn $MAVEN_CLI_OPTS install spring-boot:build-image -Pnative -Dimage.name=ghcr.io/porscheinformatik/angular-spring-heroes | |
- name: Build acceptance tests | |
run: docker build -t heroes-acceptence-tests heroes-acceptence-tests | |
- name: Run app for tests | |
run: docker run --name ash -d --rm -p 8080:8080 ghcr.io/porscheinformatik/angular-spring-heroes | |
- name: Sleep for 20s | |
uses: juliangruber/sleep-action@v2 | |
with: | |
time: 20s | |
- name: Run tests | |
run: docker run -i --rm --link ash heroes-acceptence-tests --config baseUrl=http://ash:8080 | |
- name: Cleanup app for tests | |
run: docker stop ash | |
- name: Push image to ghcr.io | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
run: | | |
docker push ghcr.io/porscheinformatik/angular-spring-heroes |