Files
TrisolarisServer/.gitea/workflows/build.yml
deploy 1f03eacd96
Some checks failed
build-and-deploy / build-deploy (push) Has been cancelled
Deploy directly without artifacts
2026-01-26 17:40:14 +05:30

39 lines
1.0 KiB
YAML

name: build-and-deploy
on:
push:
branches: [ "master" ]
jobs:
build-deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
cache: gradle
- name: Force toolchain JDK 17
run: |
if [ -f build.gradle.kts ]; then
sed -i 's/JavaLanguageVersion.of(19)/JavaLanguageVersion.of(17)/' build.gradle.kts
fi
- name: Build (skip tests)
env:
GRADLE_OPTS: "-Dorg.gradle.internal.http.connectionTimeout=60000 -Dorg.gradle.internal.http.socketTimeout=60000"
run: ./gradlew build -x test --no-daemon
- name: Deploy jar and restart
run: |
set -e
sudo mkdir -p /opt/deploy/TrisolarisServer/build/libs
sudo cp -f build/libs/*.jar /opt/deploy/TrisolarisServer/build/libs/
sudo systemctl restart TrisolarisServer.service