build-apk.sh always builds with --no-cache, which piles up images, build cache and containers on the runner over time. Add a cleanup step (if: always(), runs even on failure) that prunes everything via 'docker system prune -af --volumes' or the Podman equivalent, so self-hosted runners don't fill up their disk.
53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
typecheck:
|
|
name: Type-Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Type-check client
|
|
run: bun --cwd client run build
|
|
|
|
build-apk:
|
|
name: Build Android APK
|
|
runs-on: ubuntu-latest
|
|
needs: typecheck
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build APK via Dockerfile.android
|
|
run: ./build-apk.sh
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: tiptoi-sync-apk
|
|
path: apk-output/tiptoi-sync.apk
|
|
|
|
# Läuft immer, auch wenn der Build fehlschlägt, damit --no-cache-Images/
|
|
# Build-Cache/Container nicht den Runner-Datenträger zumüllen
|
|
# (insbesondere relevant für selbst-gehostete/Gitea-Runner).
|
|
- name: Clean up Docker/Podman build artifacts
|
|
if: always()
|
|
run: |
|
|
if command -v podman > /dev/null 2>&1; then
|
|
podman system prune -af --volumes
|
|
elif command -v docker > /dev/null 2>&1; then
|
|
docker system prune -af --volumes
|
|
fi
|