Skip to content

routes, responsible config #13

routes, responsible config

routes, responsible config #13

name: Deploy to Firebase Hosting and GitHub Pages on push
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the code
- uses: actions/checkout@v4
# Step 2: Set up Flutter
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.5' # Optionally specify the version you need
# Step 3: Install Firebase CLI globally
- name: Install Firebase CLI
run: npm install -g firebase-tools
# Step 4: Install dependencies and build for Firebase Hosting (base href is for root)
- name: Build for Firebase Hosting
run: flutter pub get && flutter build web --release --web-renderer canvaskit # /html
# Step 5: Deploy to Firebase Hosting
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_ARIFAYDURAN_DEV }}
channelId: live
projectId: arifayduran-dev
# Step 6: Build for GitHub Pages (with a specific base href for GitHub Pages)
- name: Build for GitHub Pages
run: flutter pub get && flutter build web --release --web-renderer canvaskit --base-href /arifayduran_dev/ # /html
# Step 7: Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web