Skip to content

Build example in Prod #53

Build example in Prod

Build example in Prod #53

Workflow file for this run

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