-
Notifications
You must be signed in to change notification settings - Fork 31
84 lines (73 loc) · 2.07 KB
/
server.yml
File metadata and controls
84 lines (73 loc) · 2.07 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Server CI
on:
push:
branches:
- master
- release
- develop
tags:
- "**"
paths-ignore:
- "**.md"
- "docs/**/*.yml"
pull_request:
branches:
- master
- release
- develop
permissions:
contents: read
packages: write
jobs:
build:
runs-on: [ubuntu-latest]
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 21
- name: Build
env:
BUILD_NUMBER: ${{github.run_number}}
BUILD_VERSION: ${{github.ref_name}}
run: ./gradlew :server:build --stacktrace
- name: Test
env:
BUILD_NUMBER: ${{github.run_number}}
BUILD_VERSION: ${{github.ref_name}}
run: ./gradlew :server:check --stacktrace
- name: Generate Dockerfile
run: |
cat > Dockerfile <<'EOF'
FROM ubuntu:24.04
WORKDIR /app
RUN apt-get update && apt-get install -y curl ca-certificates
COPY server/build/bin/linuxX64/releaseExecutable/server.kexe /app/server.kexe
COPY server/src/commonMain/resources/application.yaml /app/application.yaml
EXPOSE 8080
ENTRYPOINT ["./server.kexe", "--config-path", "/app/application.yaml"]
EOF
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Build & Push image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}