-
-
Save shalaby/f6b5e96a639439ddbaf982ad1c53364e to your computer and use it in GitHub Desktop.
Github Workflow for Building, Releasing Flutter web app to Github Pages and Firebase Hosting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: Build, Release app to Github Pages and Firebase Hosting | |
# name: Test, Build and Release apk | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: | |
- master | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: '12.x' | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'dev' | |
- name: 'Run flutter pub get' | |
run: flutter pub get | |
# - name: 'Run Test(s)' | |
# run: flutter test | |
- name: Enable flutter web | |
run: flutter config --enable-web | |
- name: 'Build Web App' | |
run: flutter build web | |
- name: deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.TOKEN }} | |
publish_dir: ./build/web | |
- name: Deploy to Firebase Hosting | |
uses: w9jds/firebase-action@master | |
with: | |
args: deploy --only hosting | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment