Skip to content

Commit

Permalink
ci: add prod workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cybex-dev committed Nov 20, 2024
1 parent 3d30acb commit 7676244
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/flutter-prod.yml
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

0 comments on commit 7676244

Please sign in to comment.