-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.55 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
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: 🏗️ Build backend dockerimage
run: |
APPLICATION_HITOBITO_API_TOKEN_FILE=hitobito_token ./mvnw verify
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=registry.cevi.tools/cevi/event_overview_backend:latest
working-directory: ./backend
- name: 🏗️ Build frontend dockerimage
run: docker build . --tag "registry.cevi.tools/cevi/event_overview_frontend: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:latest