Skip to content

Test web deploy

Test web deploy #3

Workflow file for this run

# This GitHub action runs on a release, when the GitHub repo is "published".
# This workflow:
# - Installs dart and flutter
# - Uses flutter stable channel.
# - Enables flutter web
# - Gets package dependencies
# - Runs dart analyze.
# - Show outdated packages, just added for info.
# - Verify that dart format is used by all committed code, fail if not.
# - Build WEB example app.
# Steps:
# - Flutter clean.
# - Flutter build web app, in release mode and with CanvasKit renderer.#
# - Deploy built Web App to GitHub pages.
name: Deploy
on:
push:
branches: [master]
paths-ignore:
- "**.md"
pull_request:
branches: [none]
paths-ignore:
- "**.md"
release:
branches: [master]
types: [publish]
jobs:
flutter_tests:
name: "Analyze app, then build and deploy web version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Flutter and Dart SDK
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: "Show Dart SDK version"
run: dart --version
- name: "Show Flutter SDK version"
run: flutter --version
- name: "Flutter Enable Web"
run: flutter config --enable-web
- name: "Get Flutter package dependencies"
run: flutter pub get
- name: "Analyze Dart source"
run: dart analyze
- name: "Show outdated packages"
run: flutter pub outdated
- name: "Verify that Dart formatting is used, fail if not"
run: dart format --output=none --set-exit-if-changed .
# Web - Build and deploy
- name: "START BUILD - Flutter clean before build"
run: flutter clean
- name: "WEB release build"
run: flutter build web --web-renderer canvaskit --base-href "/squircle/latest/" --release -t lib/main.dart
- name: "DEPLOY to GitHub Pages repository and published on commit."
uses: dmnemec/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'build/web/.'
destination_folder: 'squircle/latest'
destination_repo: 'rydmike/rydmike.github.io'
user_email: '[email protected]'
user_name: 'rydmike'