yaml全文
name: Deploy to Firebase Hosting
on:
push:
branches:
- develop
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: kuhnroyal/flutter-fvm-config-action/config@v3 # FVM設定
id: fvm-config-action
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
cache: true # Flutter SDKをキャッシュ
- name: Get dependencies
uses: actions/cache@v3
id: pub-cache
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Install dependencies # 依存関係のインストール(キャッシュがない場合のみ)
if: steps.pub-cache.outputs.cache-hit != 'true'
run: flutter pub get
- name: Generate localization files # ローカライズファイル生成
run: flutter gen-l10n --no-nullable-getter
- name: Run build_runner # build_runner実行
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Build Flutter (web) #
run: |
flutter build web -t lib/main_develop.dart
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_YOUR_PROJECT_NAME_DEVELOP }}
channelId: live
projectId: your-project-id
target: your-target
使用したアクション
参考