An Interest In:
Web News this Week
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
- April 17, 2024
November 24, 2021 09:57 am GMT
Original Link: https://dev.to/mysticza/flutter-web-x-firebase-hosting-github-action-3fke
Flutter Web x Firebase Hosting - GitHub Action
My Workflow
This GitHub Actions workflow assists Flutter developers specifically outputting to Web.
Please see the additional resource below to stay up-to-date with the required tools for this workflow to work.
The YAML files below are partially auto-generated by the Firebase CLI when setting up hosting but require additional DIY steps included for you to use directly after replacing the placeholders with the names of your secrets, project IDs, and preferred hosting channels.
Submission Category:
DIY Deployments
Yaml Files
Deploy to Firebase Hosting on Merge
# This file was PARTIALLY auto-generated by the Firebase CLI# https://github.com/firebase/firebase-toolsname: Deploy to Firebase Hosting on merge'on': push: branches: - masterjobs: build_and_deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: subosito/flutter-action@v1 #required (unofficial as no official tool exists, yet!) with: channel: 'stable' # or: 'beta', 'dev' or 'master' - run: flutter pub get && flutter build web - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' firebaseServiceAccount: '${{ secrets.YOUR-FIREBASE-SERVICE-ACCOUNT-SECRET-NAME }}' channelId: live #Your preferred Firebase channel projectId: YOUR-PROJECT-ID
Deploy to Firebase Hosting on PR
# This file was PARTIALLY auto-generated by the Firebase CLI# https://github.com/firebase/firebase-toolsname: Deploy to Firebase Hosting on PR'on': pull_requestjobs: build_and_preview: if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: subosito/flutter-action@v1 #required (unofficial as no official tool exists, yet!) with: channel: 'stable' # or: 'beta', 'dev' or 'master' - run: flutter pub get && flutter build web - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' firebaseServiceAccount: '${{ secrets.YOUR-FIREBASE-SERVICE-ACCOUNT-SECRET-NAME }}' projectId: YOUR-PROJECT-ID
Additional Resources / Info
This workflow wouldn't be possible without the brilliant:
subosito / flutter-action
Flutter environment for use in actions. It works on Linux, Windows, and macOS.
Original Link: https://dev.to/mysticza/flutter-web-x-firebase-hosting-github-action-3fke
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To