Add build workflow, readme and make-release #1
Workflow file for this run
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: | |
- '*' | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: maven | |
- name: Run build with Maven Wrapper | |
run: ./mvnw --batch-mode clean package -T 5 | |
- name: Upload war | |
uses: actions/upload-artifact@v3 | |
with: | |
name: package | |
path: target/cas-exec.war | |
- name: Log in to the Container registry | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
- name: Build and push Docker image | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |