2022-01-12 23:49:34 +01:00
|
|
|
name: Maven CI/CD
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up JDK 11
|
|
|
|
uses: actions/setup-java@v2
|
|
|
|
with:
|
|
|
|
java-version: "11"
|
|
|
|
distribution: "temurin"
|
|
|
|
cache: maven
|
2022-01-13 00:06:29 +01:00
|
|
|
- name: Install test dependencies
|
2022-01-13 00:15:37 +01:00
|
|
|
run: sudo apt-get -y -q --no-install-recommends install ffmpeg mediainfo tesseract-ocr tesseract-ocr-deu
|
2022-01-12 23:49:34 +01:00
|
|
|
- name: Build with Maven
|
2022-01-12 23:59:43 +01:00
|
|
|
run: mvn -Pprod clean install
|
2022-01-12 23:49:34 +01:00
|
|
|
- name: Upload war artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: docs-web-ci.war
|
|
|
|
path: docs-web/target/docs*.war
|
|
|
|
|
|
|
|
build_docker_image:
|
|
|
|
name: Publish to Docker Hub
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [build_and_publish]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Download war artifact
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: docs-web-ci.war
|
|
|
|
path: docs-web/target
|
|
|
|
- name: Setup up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
|
|
id: docker_build
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: true
|
2022-01-12 23:59:43 +01:00
|
|
|
tags: sismics/docs:latest
|