mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
name: Java CI
|
|
|
|
on: [ push ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
java: [ "8", "11", "17" ]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Java
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: ${{ matrix.java }}
|
|
distribution: "temurin"
|
|
cache: "maven"
|
|
|
|
- name: Build with Maven
|
|
run: mvn --batch-mode --update-snapshots verify
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
if: ${{ matrix.java == '8' }}
|
|
with:
|
|
name: commafeed.jar
|
|
path: commafeed-server/target/commafeed.jar
|
|
|
|
# Docker
|
|
- name: Login to Container Registry
|
|
if: ${{ github.ref_type == 'tag' && matrix.java == '8' }}
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Docker build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
push: ${{ github.ref_type == 'tag' && matrix.java == '8' }}
|
|
tags: |
|
|
athou/commafeed:latest
|
|
athou/commafeed:${{ github.ref_name }}
|