Files
mytimetracker/.gitea/workflows/buildAndDeply.yaml
nilzbu 64abe911ee
Some checks failed
Build-und-Deploy / build (push) Failing after 1m2s
pipeline
2025-08-09 16:04:38 +02:00

75 lines
2.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build-und-Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
# Node 20 + Git werden für Actions (checkout) benötigt
- name: 🧰 Node 20 & Git installieren
run: |
apt-get update
apt-get install -y curl ca-certificates gnupg git
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
node -v && npm -v && git --version
- name: 📥 Repository auschecken
uses: actions/checkout@v4
- name: 🧼 IP-Adresse von Gitea zu /etc/hosts hinzufügen
run: echo "172.26.0.2 gitea" >> /etc/hosts
# Gradle auf vorhandenes JDK 21 festnageln (kein Foojay-Download)
- name: ⚙️ Gradle konfigurieren
run: |
rm -rf ~/.gradle/jdks ~/.gradle/.tmp/jdks
mkdir -p ~/.gradle
{
echo "org.gradle.java.installations.auto-detect=true"
echo "org.gradle.java.installations.auto-download=false"
} > ~/.gradle/gradle.properties
# Kurze Diagnose hilfreich, falls noch etwas hakt
- name: 🔎 Java/Gradle-Info
run: |
set -x
java -version
./gradlew -v
./gradlew -q javaToolchains || true
- name: 🛠 Baue das Projekt (ohne Tests)
run: |
./gradlew clean build -x test --no-daemon --info
echo "Build-Output:"
ls -l build/libs || true
- name: 📦 JAR ins Shared Volume kopieren und archivieren
run: |
set -euo pipefail
JAR="build/libs/MyTimeTracker-0.0.1-SNAPSHOT.jar"
test -f "$JAR" || { echo "❌ JAR wurde nicht erzeugt: $JAR"; exit 1; }
mkdir -p /shared_jar_data /shared_jar_data/archive
timestamp=$(date +"%Y%m%d-%H%M%S")
# Aktuelle Version bereitstellen
cp "$JAR" /shared_jar_data/MyTimeTracker-0.0.1-SNAPSHOT.jar
# Archivkopie
cp "$JAR" "/shared_jar_data/archive/MyTimeTracker-$timestamp.jar"
echo "Inhalt /shared_jar_data:"
ls -l /shared_jar_data || true
echo "Inhalt /shared_jar_data/archive:"
ls -l /shared_jar_data/archive || true
- name: 🚦 Neustart der Anwendung triggern
run: |
mkdir -p /shared_trigger_dir
touch /shared_trigger_dir/restart-requested