-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 2.1 KB
/
build_main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Build Main
on:
push:
branches:
- main
jobs:
build_dockerimage:
name: Build dockerimage
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: ⛏ Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: 🔐 Login to Docker Hub
uses: docker/login-action@v3
with:
registry: registry.cevi.tools
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: 🔐 Prepare Hitobito Token
run: 'echo "$HITOBITO_PROD_TOKEN" > hitobito_token'
working-directory: ./backend
env:
HITOBITO_PROD_TOKEN: ${{secrets.HITOBITO_PROD_TOKEN}}
- name: 🔐 Test Backend
run: APPLICATION_HITOBITO_API_TOKEN_FILE=hitobito_token ./mvnw verify
working-directory: ./backend
- name: 🔐 Test Frontend
working-directory: ./frontend
run: |
npm ci
npm run test:ci
- name: 🏗️ Build backend dockerimage
run: ./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=registry.cevi.tools/cevi/event-overview-backend:latest
working-directory: ./backend
- name: 🏗️ Build frontend prod dockerimage
run: docker build --build-arg build_configuration=prod --tag "registry.cevi.tools/cevi/event-overview-frontend-prod:latest" .
working-directory: ./frontend
- name: 🏗️ Build frontend int dockerimage
run: docker build --build-arg build_configuration=int --tag "registry.cevi.tools/cevi/event-overview-frontend-int:latest" .
working-directory: ./frontend
- name: 🚀 Push containers to registry
run: |
docker push registry.cevi.tools/cevi/event-overview-backend:latest
docker push registry.cevi.tools/cevi/event-overview-frontend-prod:latest
docker push registry.cevi.tools/cevi/event-overview-frontend-int:latest