-
Notifications
You must be signed in to change notification settings - Fork 5
41 lines (33 loc) · 1.2 KB
/
build-release.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
name: Build and Push Docker Image
on:
push:
branches:
- master
jobs:
build-and-push-release:
name: Build and Push Release Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Registry
run: echo ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | docker login -u ${{ secrets.DOCKER_REGISTRY_USERNAME }} --password-stdin ${{ secrets.DOCKER_REGISTRY_URL }}
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- name: Gradle CI
uses: gradle/gradle-build-action@v2
with:
arguments: build
build-root-directory: backend
- name: Build and Push Docker Image
run: |
docker buildx create --use
docker buildx inspect --bootstrap
docker buildx build --platform linux/amd64 --push -t ${{ secrets.DOCKER_REGISTRY_URL }}/cmsch:release -f ./backend/Dockerfile ./backend
- name: Logout from Docker Registry
run: docker logout ${{ secrets.DOCKER_REGISTRY_URL }}