Skip to content

Commit

Permalink
ci: add deploy to firebase actions
Browse files Browse the repository at this point in the history
cybex-dev committed Sep 11, 2023

Verified

This commit was signed with the committer’s verified signature.
scala-steward Scala Steward
1 parent 81cc305 commit 8c4d3d9
Showing 5 changed files with 64 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "twilio-voice-web"
}
}
49 changes: 47 additions & 2 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
# separate terms of service, privacy policy, and support
# documentation.

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

on:
push:
@@ -37,4 +37,49 @@ jobs:
run: flutter analyze

- name: Run tests
run: flutter test --coverage
run: flutter test --coverage

deploy-example-web:
runs-on: ubuntu-latest
# needs: build

steps:
- uses: actions/checkout@v2

- name: Setup Flutter build environment
uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.6'
channel: 'stable'
cache: true

- name: current directory
run: echo $PWD
- run: ls -la

- name: Change working directory
run: cd ./example

- name: current directory
run: echo $PWD
- run: ls -la

- run: flutter --version
- run: flutter pub get
- run: flutter config --enable-web
- run: echo $PWD; flutter build web --release --target=lib/main.dart --output=build/web

- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: web-build
path: build/web

- name: Firebase Deploy
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_TWILIO_VOICE_WEB }}'
channelId: live
projectId: twilio-voice-web

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -45,3 +45,5 @@ build/

# Lock files
*.lock

*.log
1 change: 0 additions & 1 deletion example/.gitignore
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols
10 changes: 10 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"hosting": {
"public": "example/build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}

0 comments on commit 8c4d3d9

Please sign in to comment.