Skip to content

Commit 8c554ca

Browse files
committed
ci: add deploy to firebase actions
1 parent 81cc305 commit 8c554ca

File tree

5 files changed

+53
-3
lines changed

5 files changed

+53
-3
lines changed

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "twilio-voice-web"
4+
}
5+
}

.github/workflows/flutter.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# separate terms of service, privacy policy, and support
44
# documentation.
55

6-
name: Flutter Analyze & Test (main)
6+
name: Flutter analyze, test & deploy example web app
77

88
on:
99
push:
@@ -37,4 +37,38 @@ jobs:
3737
run: flutter analyze
3838

3939
- name: Run tests
40-
run: flutter test --coverage
40+
run: flutter test --coverage
41+
42+
deploy-example-web:
43+
runs-on: ubuntu-latest
44+
# needs: build
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
49+
- name: Setup Flutter build environment
50+
uses: subosito/flutter-action@v2
51+
with:
52+
flutter-version: '3.10.6'
53+
channel: 'stable'
54+
cache: true
55+
56+
- run: flutter --version
57+
- run: flutter pub get
58+
- run: flutter config --enable-web
59+
- run: cd ./example; flutter build web --release --target=lib/main.dart --output=build/web
60+
61+
- name: Archive Production Artifact
62+
uses: actions/upload-artifact@master
63+
with:
64+
name: web-build
65+
path: example/build/web
66+
67+
- name: Firebase Deploy
68+
uses: FirebaseExtended/action-hosting-deploy@v0
69+
with:
70+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
71+
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_TWILIO_VOICE_WEB }}'
72+
channelId: live
73+
projectId: twilio-voice-web
74+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ build/
4545

4646
# Lock files
4747
*.lock
48+
49+
*.log

example/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
/build/
3333

3434
# Web related
35-
lib/generated_plugin_registrant.dart
3635

3736
# Symbolication related
3837
app.*.symbols

firebase.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"hosting": {
3+
"public": "example/build/web",
4+
"ignore": [
5+
"firebase.json",
6+
"**/.*",
7+
"**/node_modules/**"
8+
]
9+
}
10+
}

0 commit comments

Comments
 (0)