Release Containerimage #47
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: Release Containerimage | |
on: | |
push: | |
branches: | |
- dev | |
- feature/44WorkFlow | |
workflow_dispatch: | |
jobs: | |
build-test-push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: checkout | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
run: mvn clean install | |
- name: Run integrationTests | |
run: | | |
docker run -d --name gamertrack-test-container -p 8080:8080 gamertrack-war:latest | |
sleep 30 | |
mvn verify -Prun-integrationtests | |
docker stop gamertrack-test-container | |
docker rm gamertrack-test-container | |
- name: Log in to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Build Docker Image and Push to GHCR | |
run: | | |
docker tag gamertrack-war:latest ghcr.io/gepardec/gepardec-gamertrack:dev | |
docker push ghcr.io/gepardec/gepardec-gamertrack:dev |