-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.68 KB
/
api-checks.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 and check API
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 22
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.9
- name: Compile assets
working-directory: api
shell: bash
run: ./compile-assets.main.kts
- name: Run checks
working-directory: api
run: ./gradlew build check shadowJar
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set container vars
working-directory: api
shell: bash
run: |
echo "CONTAINER_TAG=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "STATIC_ASSETS_PATH=build/static" >> $GITHUB_ENV
echo "TEMPLATE_ASSETS_PATH=build/templates" >> $GITHUB_ENV
echo "JAR_PATH=$(find app/build/libs/*-all.jar | head -n1)" >> $GITHUB_ENV
- name: Build container
uses: docker/build-push-action@v6
with:
push: false
context: "./api"
platforms: "linux/amd64,linux/arm64"
build-args: |
jar=${{ env.JAR_PATH }}
static_assets=${{ env.STATIC_ASSETS_PATH }}
template_assets=${{ env.TEMPLATE_ASSETS_PATH }}
version=${{ env.CONTAINER_TAG }}
tags: github.com/lopcode/photo-fox:${{ env.CONTAINER_TAG }}