Ios/20250813 #556
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |