-
Notifications
You must be signed in to change notification settings - Fork 9
74 lines (61 loc) · 1.89 KB
/
build_web.yaml
File metadata and controls
74 lines (61 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Deploy Cooketh Flow Web
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.29.2'
channel: 'stable'
- name: Enable web support
run: flutter config --enable-web
- name: Check Flutter setup
run: flutter doctor
- name: Install dependencies
run: flutter pub get
- name: Verify web configuration
run: |
if [ -f "web/index.html" ]; then
echo "Web configuration found"
else
echo "Error: web/index.html not found. Ensure web support is enabled in your project."
exit 1
fi
- name: Build web
run: flutter build web --release --web-renderer canvaskit
- name: Debug build output
run: |
echo "Current directory: $(pwd)"
ls -la
if [ -d "build/web" ]; then
echo "build/web exists"
ls -la build/web
else
echo "Error: build/web directory not found"
exit 1
fi
- name: Copy build to temporary directory
run: |
mkdir -p /tmp/web-build
cp -r build/web/* /tmp/web-build/
- name: Create or update web branch
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git checkout -B web
rm -rf ./*
cp -r /tmp/web-build/* .
git add .
git commit -m "Deploy web build" || echo "No changes to commit"
git push origin web --force
- name: Debug web branch contents
run: |
echo "Web branch contents after deployment:"
ls -la