74 lines
2.3 KiB
YAML
74 lines
2.3 KiB
YAML
name: Java CI with Maven
|
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
on: [push]
|
|
|
|
jobs:
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
cache: maven
|
|
- name: Set up Maven
|
|
uses: stCarolas/setup-maven@v4.5
|
|
with:
|
|
maven-version: 3.8.2
|
|
- name: Build with Maven
|
|
run: mvn -B package --file backend/pom.xml
|
|
|
|
build-and-push-frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Log into registry at Gitea
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: https://git.fawkes100.de
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
- name: Setup Docker buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v2
|
|
with:
|
|
images: git.fawkes100.de/TimeManager/timemanager-frontend
|
|
- name: Build and Push Latest Docker Image
|
|
id: build-and-push-latest
|
|
uses: docker/build-push-action@v4
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
with:
|
|
file: frontend/Dockerfile
|
|
push: true
|
|
tags: git.fawkes100.de/TimeManager/timemanager-frontend:latest
|
|
build-and-push-backend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Log into registry at Gitea
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: https://git.fawkes100.de
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
- name: Setup Docker buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v2
|
|
with:
|
|
images: git.fawkes100.de/TimeManager/timemanager-backend
|
|
- name: Build and Push Latest Docker Image
|
|
id: build-and-push-latest
|
|
uses: docker/build-push-action@v4
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
with:
|
|
file: backend/Dockerfile
|
|
push: true
|
|
tags: git.fawkes100.de/TimeManager/timemanager-backend:latest |