-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Flutter analyze, test & deploy example web app | ||
|
||
on: | ||
push: | ||
branches: [ "prod" ] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build_and_test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version-file: pubspec.yaml | ||
channel: 'stable' | ||
cache: true | ||
|
||
- run: flutter --version | ||
|
||
- name: Install dependencies | ||
run: flutter pub get | ||
|
||
- name: Analyze project source | ||
run: flutter analyze | ||
|
||
- name: Run tests | ||
run: flutter test --coverage | ||
|
||
deploy-example-web: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Flutter build environment | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version-file: example/pubspec.yaml | ||
channel: 'stable' | ||
cache: true | ||
|
||
- run: flutter config --enable-web | ||
- run: cd ./example; 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: example/build/web | ||
|
||
- name: Firebase Deploy | ||
uses: FirebaseExtended/action-hosting-deploy@v0 | ||
with: | ||
repoToken: '${{ secrets.GITHUB_TOKEN }}' | ||
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_JS_NOTIFICATIONS_WEB }}' | ||
projectId: js-notifications-web | ||
|