Skip to content

Commit 8f4e05b

Browse files
committed
web build with temporary directory to store build/web
1 parent 2d71b80 commit 8f4e05b

1 file changed

Lines changed: 33 additions & 4 deletions

File tree

.github/workflows/build_web.yaml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,53 @@ jobs:
2222
- name: Enable web support
2323
run: flutter config --enable-web
2424

25+
- name: Check Flutter setup
26+
run: flutter doctor
27+
2528
- name: Install dependencies
2629
run: flutter pub get
2730

31+
- name: Verify web configuration
32+
run: |
33+
if [ -f "web/index.html" ]; then
34+
echo "Web configuration found"
35+
else
36+
echo "Error: web/index.html not found. Ensure web support is enabled in your project."
37+
exit 1
38+
fi
39+
2840
- name: Build web
29-
run: flutter build web --release
41+
run: flutter build web --release --web-renderer canvaskit
3042

3143
- name: Debug build output
3244
run: |
45+
echo "Current directory: $(pwd)"
3346
ls -la
34-
ls -la build/web || echo "build/web directory not found"
47+
if [ -d "build/web" ]; then
48+
echo "build/web exists"
49+
ls -la build/web
50+
else
51+
echo "Error: build/web directory not found"
52+
exit 1
53+
fi
54+
55+
- name: Copy build to temporary directory
56+
run: |
57+
mkdir -p /tmp/web-build
58+
cp -r build/web/* /tmp/web-build/
3559
3660
- name: Create or update web branch
3761
run: |
3862
git config --global user.name 'github-actions[bot]'
3963
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
4064
git checkout -B web
4165
rm -rf ./*
42-
cp -r build/web/* .
66+
cp -r /tmp/web-build/* .
4367
git add .
4468
git commit -m "Deploy web build" || echo "No changes to commit"
45-
git push origin web --force
69+
git push origin web --force
70+
71+
- name: Debug web branch contents
72+
run: |
73+
echo "Web branch contents after deployment:"
74+
ls -la

0 commit comments

Comments
 (0)