Skip to content

Merge pull request #3 from nozomi-koborinai/feature/fix-ui #2

Merge pull request #3 from nozomi-koborinai/feature/fix-ui

Merge pull request #3 from nozomi-koborinai/feature/fix-ui #2

Workflow file for this run

name: Deploy to Firebase Hosting on merge
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- "genkit/**"
jobs:
build_and_deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Read Flutter SDK version
run: echo "FLUTTER_VERSION=$(jq -r '.flutterSdkVersion' .fvm/fvm_config.json)" >> $GITHUB_ENV
shell: bash
- name: Create Firebase options file
run: |
cat <<EOF > ./lib/firebase_options.dart
${{ secrets.FIREBASE_CONFIG }}
EOF
- name: Create dot_env file
run: |
cat <<EOF > ./.env
${{ secrets.DOT_ENV }}
EOF
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: flutter pub get
run: flutter pub get
- name: flutter build web
run: flutter build web
- name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_MAIL }}
create_credentials_file: true
export_environment_variables: true
- name: Deploy to Firebase Hosting
run: |
npm install -g firebase-tools
firebase deploy --only hosting --project=${{ secrets.PROJECT_ID }}