-
Notifications
You must be signed in to change notification settings - Fork 9
88 lines (73 loc) · 2.47 KB
/
deploy_web.yaml
File metadata and controls
88 lines (73 loc) · 2.47 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Deploy Cooketh Flow Web
on:
push:
branches:
- rewrite
pull_request:
branches:
- rewrite
types:
- closed
permissions:
contents: write
jobs:
build-and-deploy:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
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: Debug environment variables
run: |
echo "SUPABASE_URL is set: ${{ secrets.SUPABASE_URL != '' }}"
echo "SUPABASE_KEY is set: ${{ secrets.SUPABASE_KEY != '' }}"
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
- name: Build web
run: flutter build web --release --no-source-maps --dart-define="SUPABASE_URL=${{ secrets.SUPABASE_URL }}" --dart-define="SUPABASE_KEY=${{ secrets.SUPABASE_KEY }}"
- 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: Debug temporary directory
run: |
echo "Temporary directory contents:"
ls -la /tmp/web-build/
- name: Create or update gh-pages 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 gh-pages
rm -rf ./*
cp -r /tmp/web-build/* .
echo "cookethflow.cookethcompany.xyz" > CNAME
git add .
git commit -m "Deploy web build to gh-pages" || echo "No changes to commit"
git push origin gh-pages --force
- name: Debug gh-pages branch contents
run: |
echo "gh-pages branch contents after deployment:"
ls -la