Build example in Prod #53
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: Build example in Prod | |
on: [workflow_dispatch] | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: "12.x" | |
cache: gradle | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
architecture: x64 | |
cache: true | |
cache-key: 'flutter-:os:-:channel:-:version:-:arch:' | |
- name: Flutter Doctor | |
run: flutter doctor | |
working-directory: ./ | |
- name: Upgrades flutter | |
run: flutter upgrade | |
working-directory: ./ | |
- name: Enable Web | |
run: flutter config --enable-web | |
working-directory: ./example | |
- name: Install dependencies | |
run: flutter packages get | |
working-directory: ./ | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
# timeout-minutes: 15 | |
# - name: Install dependencies | |
# run: | | |
# flutter clean | |
# flutter pub upgrade | |
# working-directory: ./ | |
- name: Build Web | |
run: flutter build web | |
working-directory: ./example | |
- name: Fix PWA | |
run: sed -i'.js' -e 's+"/"+""+g' flutter_service_worker.js #https://github.com/flutter/flutter/issues/68449 | |
working-directory: ./example/build/web | |
- name: Deploy 🚀 | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: ./example/build/web |