Skip to content

Update firebase-hosting-merge.yml #294

Update firebase-hosting-merge.yml

Update firebase-hosting-merge.yml #294

# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Build and Deploy
"on":
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: echo $GOOGLE_SERVICES_JSON | base64 -d > android/app/google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
- run: echo $GOOGLE_SERVICES_INFO_PLIST | base64 -d > ios/Runner/GoogleService-Info.plist
env:
GOOGLE_SERVICES_INFO_PLIST: ${{ secrets.GOOGLE_SERVICES_INFO_PLIST }}
- run: echo $KEY_JKS | base64 -d > android/key.jks
env:
KEY_JKS: ${{ secrets.KEY_JKS }}
- run: echo $KEY_PROPERTIES | base64 -d > android/key.properties
env:
KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }}
- run: echo $FIREBASE_UTILS_OPTIONS | base64 -d > lib/utils/firebase_options.dart
env:
FIREBASE_UTILS_OPTIONS: ${{ secrets.FIREBASE_UTILS_OPTIONS }}
- run: flutter clean
- run: flutter pub get
# Use the setup-shorebird action to configure Shorebird
- name: 🐦 Setup Shorebird
uses: shorebirdtech/setup-shorebird@v1
- name: Publish Shorebird Patch
env:
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
run: shorebird patch android --release-version 0.7.9+31 -- --dart-define=SUPABASE_PROJECT_URL=${{secrets.SUPABASE_PROJECT_URL}} --dart-define=SUPABASE_API_KEY=${{secrets.SUPABASE_API_KEY}} --dart-define=SUPABASE_REDIRECT_URL=${{secrets.SUPABASE_REDIRECT_URL}} --dart-define=FIREBASE_VAPID_KEY=${{ secrets.FIREBASE_VAPID_KEY }}--dart-define=ADMIN_EMAIL=${{ secrets.ADMIN_EMAIL }} --dart-define=FCM_SERVER_KEY=${{ secrets.FCM_SERVER_KEY }}
# - run: flutter pub run build_runner build --delete-conflicting-outputs
- run: flutter build web --release --dart-define=SUPABASE_PROJECT_URL=${{secrets.SUPABASE_PROJECT_URL}} --dart-define=SUPABASE_API_KEY=${{secrets.SUPABASE_API_KEY}} --dart-define=SUPABASE_REDIRECT_URL=${{secrets.SUPABASE_REDIRECT_URL}} --dart-define=SUPABASE_SERVICE_ROLE=${{secrets.SUPABASE_SERVICE_ROLE}} --dart-define=FIREBASE_VAPID_KEY=${{ secrets.FIREBASE_VAPID_KEY }} --dart-define=ADMIN_EMAIL=${{ secrets.ADMIN_EMAIL }} --dart-define=FCM_SERVER_KEY=${{ secrets.FCM_SERVER_KEY }}
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_VOCABHUB_34C7F }}"
channelId: live
projectId: vocabhub-34c7f
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
# test integration test
# - name: 📦 Install dependencies
# run: flutter pub get
# - name: 📱 Run integration test
# run: flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart --no-build --dart-define=SUPABASE_PROJECT_URL=${{secrets.SUPABASE_PROJECT_URL}} --dart-define=SUPABASE_API_KEY=${{secrets.SUPABASE_API_KEY}} --dart-define=SUPABASE_REDIRECT_URL=${{secrets.SUPABASE_REDIRECT_URL}} --dart-define=FIREBASE_VAPID_KEY=${{ secrets.FIREBASE_VAPID_KEY }}
# - name: Create Shorebird release
# env:
# SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
# run: shorebird release android -- --dart-define=SUPABASE_PROJECT_URL=${{secrets.SUPABASE_PROJECT_URL}} --dart-define=SUPABASE_API_KEY=${{secrets.SUPABASE_API_KEY}} --dart-define=SUPABASE_REDIRECT_URL=${{secrets.SUPABASE_REDIRECT_URL}} --dart-define=FIREBASE_VAPID_KEY=${{ secrets.FIREBASE_VAPID_KEY }}
# - uses: actions/upload-artifact@v1
# with:
# name: Android app bundle
# path: build/app/outputs/bundle/release/app-release.aab