updated version to 1.14.4 #229
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: | |
- master | |
tags: | |
- "v*.*.*" | |
workflow_dispatch: | |
jobs: | |
build-java-source: | |
name: build jar file | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Java build environmant | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
cache: 'maven' | |
- name: Build with Maven | |
run: mvn package -DskipTests | |
- name: Upload jar file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coach.jar | |
path: target/coach.jar | |
build-image: | |
name: build Docker image | |
needs: build-java-source | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{github.repository}} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log into container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Image metadata | |
id: image_metadata | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=semver,pattern={{version}} | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Download jar file | |
uses: actions/download-artifact@v3 | |
with: | |
name: coach.jar | |
path: target | |
- name: Build Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
context: . | |
tags: ${{ steps.image_metadata.outputs.tags }} | |
labels: ${{ steps.image_metadata.outputs.labels }} |