Skip to content

Instantly share code, notes, and snippets.

@salihgueler
Created August 21, 2024 17:48
Show Gist options
  • Save salihgueler/565de2c98c2db90e7c815604a6afed42 to your computer and use it in GitHub Desktop.
Save salihgueler/565de2c98c2db90e7c815604a6afed42 to your computer and use it in GitHub Desktop.
Deploy Flutter Applications through Amplify Hosting
version: 1
backend:
phases:
build:
commands:
- npm ci --cache .npm --prefer-offline
- npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID --outputs-format dart --outputs-out-dir lib
frontend:
phases:
preBuild:
commands:
- echo "Installing Flutter SDK"
- git clone https://github.com/flutter/flutter.git -b stable --depth 1
- export PATH="$PATH:$(pwd)/flutter/bin"
- flutter config --no-analytics
- flutter doctor
build:
commands:
- echo "Installing dependencies"
- flutter pub get
- echo "Building Flutter web application with WASM support"
- flutter build web
artifacts:
baseDirectory: build/web
files:
- '**/*'
cache:
paths:
- flutter/.pub-cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment