Last active
July 8, 2020 12:18
-
-
Save chinmay-sh/1912920f6c7311e1854bb8061493e10b to your computer and use it in GitHub Desktop.
Workflow for flutter web deployment on ghpages and firebase
This file contains 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
name: Flutter Web Firebase | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
firebase-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: '12.x' | |
- uses: subosito/flutter-action@v1 | |
with: | |
flutter-version: '1.19.x' # you can use 1.19 | |
channel: 'beta' # Currently you have to use beta channel for Flutter web. | |
- name: Upgrades flutter | |
run: flutter pub get | |
- name: Enable Web | |
run: flutter config --enable-web | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build Web | |
run: flutter build web | |
- name: Deploy to Firebase | |
uses: w9jds/firebase-action@v1.5.0 | |
with: | |
args: deploy --only hosting | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} |
This file contains 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
name: Flutter Web Ghpages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
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: | |
flutter-version: '1.19.x' # you can use 1.19 | |
channel: 'beta' # Currently you have to use beta channel for Flutter web. | |
- name: Upgrades flutter | |
run: flutter pub get | |
- name: Enable Web | |
run: flutter config --enable-web | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build Web | |
run: flutter build web | |
- name: Deploy | |
run: | | |
cd ./build/web | |
git init | |
git config user.name "redlord-ci" | |
git config user.email "redlord-ci@github.com" | |
git remote add secure-origin https://${{ secrets.ACCESS_TOKEN }}@github.com/the-redlord/[repo_name].git | |
git checkout -b gh-pages | |
git add . | |
git commit -m "Updated docs" | |
git push --force secure-origin gh-pages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment