Skip to content

Commit be1d5d5

Browse files
committed
workflow: fix workflow getting out of memory
1 parent 9c79b45 commit be1d5d5

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

.github/workflows/nightlydepolyci.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,29 @@ on:
66
- main
77

88
jobs:
9-
build:
9+
build-and-deploy:
10+
name: Build and Deploy Nightly APK to F-Droid
1011
runs-on: ubuntu-latest
1112

1213
steps:
13-
# Step 1: Checkout the main branch
14+
# Step 0: Free up disk space (CRITICAL FIX)
15+
# This removes unused tools (Dotnet, Haskell, Docker) to prevent "No space left" errors.
16+
- name: Free Disk Space (Ubuntu)
17+
uses: jlumbroso/free-disk-space@main
18+
with:
19+
tool-cache: false
20+
android: false # Keep Android SDKs for Flutter
21+
dotnet: true
22+
haskell: true
23+
large-packages: true
24+
docker-images: true
25+
swap-storage: true
26+
27+
# Step 1: Checkout the main branch (Shallow clone)
1428
- name: Checkout Main Branch
15-
uses: actions/checkout@v2
29+
uses: actions/checkout@v4
1630
with:
17-
fetch-depth: 0
31+
fetch-depth: 1 # Changed from 0 to 1 to save disk space
1832

1933
# Step 2: Setup Java with version 17.x
2034
- uses: actions/setup-java@v4
@@ -24,7 +38,7 @@ jobs:
2438

2539
# Step 3: Setup Flutter with version 3.29.2
2640
- name: Setup Flutter
27-
uses: subosito/flutter-action@v1
41+
uses: subosito/flutter-action@v2
2842
with:
2943
flutter-version: "3.29.2"
3044

@@ -54,6 +68,7 @@ jobs:
5468
run: |
5569
git config --global user.name "github-actions[bot]"
5670
git config --global user.email "github-actions[bot]@users.noreply.github.com"
71+
# Fetch only the specific branch needed (works even with shallow checkout)
5772
git fetch origin fdroid-repo:fdroid-repo
5873
git stash || echo "No changes to stash"
5974
git checkout fdroid-repo
@@ -72,9 +87,7 @@ jobs:
7287
echo "5 or fewer APKs found. No cleanup needed."
7388
fi
7489
75-
# Step 10: Setup F-Droid (install fdroidserver) and update the repo
76-
- name: Fdroid Install
77-
uses: subosito/flutter-action@v1
90+
# Step 10: Setup F-Droid and update the repo
7891
- name: Run F-Droid Update
7992
env:
8093
FDROID_CONFIG_YML_B64: ${{ secrets.FDROID_CONFIG_YML }}
@@ -88,10 +101,10 @@ jobs:
88101
sudo apt-get update
89102
sudo apt-get install -y fdroidserver
90103
91-
# Run the update command, referencing the files
104+
# Run the update command
92105
fdroid update -c
93106
94-
# Step 12: Push the updated repo files with amended commit
107+
# Step 11: Push the updated repo files with amended commit
95108
- name: Push F-Droid updates
96109
run: |
97110
git add .

0 commit comments

Comments
 (0)