2023-11-11 11:20:48 +01:00
|
|
|
name: Java CI with Maven
|
|
|
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
2023-11-13 22:01:00 +01:00
|
|
|
test:
|
2023-11-11 11:20:48 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-11-13 22:01:00 +01:00
|
|
|
build-and-push-frontend:
|
2023-11-13 22:32:02 +01:00
|
|
|
runs-on: ubuntu-latest
|
2023-11-13 22:01:00 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Log into registry at Gitea
|
|
|
|
uses: docker/login-action@v2
|
2023-11-14 08:52:19 +01:00
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
2023-11-13 22:01:00 +01:00
|
|
|
with:
|
|
|
|
registry: https://git.fawkes100.de
|
|
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Setup Docker buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-11-14 08:54:21 +01:00
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
2023-11-13 22:01:00 +01:00
|
|
|
- name: Extract Docker metadata
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v2
|
2023-11-14 08:52:19 +01:00
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
2023-11-13 22:01:00 +01:00
|
|
|
with:
|
2023-11-14 08:31:12 +01:00
|
|
|
images: git.fawkes100.de/sebastian/timemanager/timemanager-frontend
|
2023-11-13 22:01:00 +01:00
|
|
|
- name: Build and Push Latest Docker Image
|
|
|
|
id: build-and-push-latest
|
|
|
|
uses: docker/build-push-action@v4
|
2023-11-14 08:52:19 +01:00
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
2023-11-13 22:01:00 +01:00
|
|
|
with:
|
2023-11-14 07:52:41 +01:00
|
|
|
context: frontend/.
|
2023-11-13 22:03:55 +01:00
|
|
|
file: frontend/Dockerfile
|
2023-11-13 22:01:00 +01:00
|
|
|
push: true
|
2023-11-14 08:44:31 +01:00
|
|
|
tags: git.fawkes100.de/sebastian/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
|
2023-11-14 08:52:19 +01:00
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
2023-11-14 08:44:31 +01:00
|
|
|
with:
|
|
|
|
registry: https://git.fawkes100.de
|
|
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Setup Docker buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-11-14 08:52:19 +01:00
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
2023-11-14 08:44:31 +01:00
|
|
|
- name: Extract Docker metadata
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v2
|
2023-11-14 08:52:19 +01:00
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
2023-11-14 08:44:31 +01:00
|
|
|
with:
|
|
|
|
images: git.fawkes100.de/sebastian/timemanager/timemanager-backend
|
|
|
|
- name: Build and Push Latest Docker Image
|
|
|
|
id: build-and-push-latest
|
|
|
|
uses: docker/build-push-action@v4
|
2023-11-14 08:52:19 +01:00
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
2023-11-14 08:44:31 +01:00
|
|
|
with:
|
|
|
|
context: backend/.
|
|
|
|
file: backend/Dockerfile
|
|
|
|
push: true
|
|
|
|
tags: git.fawkes100.de/sebastian/timemanager/timemanager-backend:latest
|