updated readme #29
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 | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- v* | |
pull_request: | |
types: [ opened, reopened ] | |
branches: [ main ] | |
jobs: | |
build-with-maven: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Cache Maven packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Generate build info | |
run: ./generate-build-info.sh | |
- name: Generate keystore | |
run: ./generate-keystore.sh | |
- name: Build with Maven | |
run: mvn --batch-mode --update-snapshots verify | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ github.repository_owner }}/${{ github.event.repository.name }} | |
- name: Log in to Docker Hub | |
if: ${{ github.event.repository.name == 'spring-boot-scala-example' && github.event_name != 'pull_request' }} | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: ${{ github.event.repository.name == 'spring-boot-scala-example' && github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-with-sbt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Generate build info | |
run: ./generate-build-info.sh | |
- name: Generate keystore | |
run: ./generate-keystore.sh | |
- name: Build with sbt | |
run: sbt -v test assembly |