-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (105 loc) · 4.1 KB
/
release.yaml
File metadata and controls
126 lines (105 loc) · 4.1 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Build and Deploy Angular with Flutter Module to Firebase
on:
push:
branches:
- master # Trigger the workflow on pushes to the main branch. Adjust as needed.
jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
flutter-version: [3.24.0] # Specify the Flutter version you need
steps:
# Step 1: Checkout the Angular repository
- name: Checkout Angular Repository
uses: actions/checkout@v3
# Step 2: Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
# Step 3: Install Angular Dependencies
- name: Install Angular Dependencies
run: npm install # Installs Angular project dependencies as defined in package.json
# Step 3: Setup Flutter
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
# Step 4: Clone Wellness Flutter Module
- name: Clone Wellness Flutter Module
uses: actions/checkout@v3
with:
repository: devnaseem/mbc_wellness
path: mbc_wellness
# Step 5: Build Wellness Flutter Web
- name: Build Wellness Flutter Web
run: |
cd mbc_wellness
flutter pub get
flutter build web --release -t lib/main_web_entry.dart --web-renderer html
cd ..
# Step 6: Clone Gallery Flutter Module
- name: Clone Gallery Flutter Module
uses: actions/checkout@v3
with:
repository: devnaseem/mbc_gallery
path: mbc_gallery
# Step 7: Build Gallery Flutter Module
- name: Build Gallery Flutter Web
run: |
cd mbc_gallery
flutter pub get
flutter build web --release -t lib/main_web_entry.dart --web-renderer html
cd ..
# Step 7: Prepare Angular Assets Directory
- name: Prepare Angular Assets Directory
run: |
mkdir -p src/assets/flutter/wellness
mkdir -p src/assets/flutter/gallery
# Step 8: Copy Wellness Flutter Assets
- name: Copy Wellness Flutter Assets
run: |
cp -r mbc_wellness/build/web/* src/assets/flutter/wellness/
# Exclude flutter.js if already handled
# Step 9: Copy Gallery Flutter Assets
- name: Copy Gallery Flutter Assets
run: |
cp -r mbc_gallery/build/web/* src/assets/flutter/gallery/
# Exclude flutter.js to prevent duplication
- name: Copy Shared flutter.js
run: |
echo "Copying shared flutter.js..."
if [ -f mbc_wellness/build/web/flutter.js ]; then
cp mbc_wellness/build/web/flutter.js src/assets/flutter/
echo "Copied flutter.js from wellness module."
else
echo "flutter.js not found in wellness module."
exit 1
fi
# Remove flutter.js from gallery module to avoid duplication
if [ -f mbc_gallery/build/web/flutter.js ]; then
rm mbc_gallery/build/web/flutter.js
echo "Removed flutter.js from gallery module."
else
echo "No flutter.js in gallery_flutter."
fi
# Step 11: Clean Up Cloned Repositories (Optional)
- name: Clean Up Cloned Repositories
run: |
rm -rf wellness_flutter
rm -rf gallery_flutter
# Step 12: Build Angular Application
- name: Build Angular App
run: npx ng build --configuration production
# Step 12: Install Firebase CLI
- name: Install Firebase CLI
run: npm install -g firebase-tools
# Step 13: Deploy to Firebase Hosting
- name: Deploy to Firebase
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} # Accesses the Firebase token from GitHub Secrets
run: firebase deploy --only hosting --token $FIREBASE_TOKEN
# '--only hosting' ensures only the hosting service is deployed. Adjust if deploying other services.