5
5
6
6
name : Deploy PR on Github Pages
7
7
8
+ env :
9
+ FLUTTER_VERSION : 3.27.4
10
+
8
11
concurrency :
9
12
group : ${{ github.workflow }}-${{ github.ref }}
10
13
@@ -17,40 +20,78 @@ jobs:
17
20
url : ${{ steps.configure.outputs.URL }}
18
21
19
22
steps :
23
+ # 🧹 Free up space before building
24
+ - name : Free up disk space before build
25
+ run : |
26
+ echo "=== Disk space before cleanup ==="
27
+ df -h
28
+ sudo rm -rf /usr/share/dotnet
29
+ sudo rm -rf /usr/local/lib/android
30
+ sudo rm -rf /opt/ghc
31
+ sudo apt-get clean
32
+ sudo apt-get autoclean
33
+ echo "=== Disk space after cleanup ==="
34
+ df -h
35
+
36
+ # 🔄 Checkout code
20
37
- name : Checkout repository
21
38
uses : actions/checkout@v4
22
39
23
- - name : Setup flutter
40
+ # 🧰 Setup Flutter
41
+ - name : Setup Flutter
24
42
uses : subosito/flutter-action@v2
25
43
with :
26
- flutter-version : " 3.27.4 "
44
+ flutter-version : ${{ env.FLUTTER_VERSION }}
27
45
channel : " stable"
28
46
cache : true
29
47
cache-key : deps-${{ hashFiles('**/pubspec.lock') }} # optional, change this to force refresh cache
30
48
cache-path : ${{ runner.tool_cache }}/flutter # optional, change this to specify the cache path
31
49
50
+ # 🧹 Clean Flutter cache before building
51
+ - name : Flutter clean
52
+ run : flutter clean
53
+
54
+ # 📦 Run prebuild (if any)
32
55
- name : Run prebuild
33
56
run : ./scripts/prebuild.sh
34
57
58
+ # ⚙️ Configure environment for PR
35
59
- name : Configure environments
36
60
id : configure
37
61
env :
38
62
FOLDER : ${{ github.event.pull_request.number }}
39
63
run : ./scripts/configure-web-environment.sh
40
64
41
- - name : Build
65
+ # 🧱 Build Flutter Web (release)
66
+ - name : Build Web (Release)
42
67
env :
43
68
FOLDER : ${{ github.event.pull_request.number }}
44
- run : ./scripts/build-web.sh
69
+ run : |
70
+ echo "=== Disk usage before build ==="
71
+ df -h
72
+ ./scripts/build-web.sh
73
+ echo "=== Disk usage after build ==="
74
+ df -h
45
75
46
- - name : Deploy to Github Pages
76
+ # 🚀 Deploy to GitHub Pages
77
+ - name : Deploy to GitHub Pages
47
78
uses : peaceiris/actions-gh-pages@v4
48
79
with :
49
80
github_token : ${{ secrets.GITHUB_TOKEN }}
50
81
destination_dir : ${{ github.event.pull_request.number }}
51
82
keep_files : true
52
83
publish_dir : " build/web"
53
84
85
+ # 🧹 Clean up after build to save space
86
+ - name : Cleanup after deploy
87
+ if : always()
88
+ run : |
89
+ rm -rf build/
90
+ rm -rf .dart_tool/
91
+ echo "=== Disk usage after cleanup ==="
92
+ df -h
93
+
94
+ # 💬 Create or update comments on PR
54
95
- name : Find deployment comment
55
96
uses : peter-evans/find-comment@v3
56
97
id : fc
0 commit comments