.gitea/workflows/update.yml aktualisiert

This commit is contained in:
2025-12-20 19:05:50 +01:00
parent 2102ff0c6e
commit 50cb2f2706

View File

@@ -1,15 +1,42 @@
name: CI name: Host Maintenance
on: on:
schedule: schedule:
- cron: "0 18 * * *" - cron: "0 3 * * *" # täglich 03:00
workflow_dispatch: # manuell startbar
jobs: jobs:
test: maintenance:
runs-on: gitea-runner name: Update host system
runs-on: host # MUSS exakt zum Runner-Label passen
steps: steps:
- run: # --- Debug / Sicherheit ---
hostname - name: Show workflow context
cat /etc/debian_version run: |
apt update echo "Branch: $GITEA_REF_NAME"
apt -y upgrade echo "Commit: $GITEA_SHA"
echo "finished" echo "Runner: $(hostname)"
echo "User: $(whoami)"
echo "Date: $(date)"
echo "Kernel: $(uname -a)"
# --- Sicherheitsbremse ---
- name: Ensure correct branch
run: |
if [ "$GITEA_REF_NAME" != "main" ]; then
echo "❌ This workflow must run on main only"
exit 1
fi
# --- System Update ---
- name: Update packages
run: |
sudo apt update
sudo apt -y upgrade
# --- Optional: Aufräumen ---
- name: Cleanup
run: |
sudo apt -y autoremove
sudo apt -y autoclean