这是我将 Flutter Web 应用程序部署到 Azure 静态 Web 应用程序的方式:
- 从here获取颤振任务
- 使用此 yaml 文件进行部署以将 Flutter 应用部署到 Azure 静态 Web 应用中:
- 不要忘记为静态 Web 应用令牌设置变量
trigger:
- http-request
pool:
vmImage: ubuntu-latest
steps:
- task: Hey24sheep.flutter.flutter-install.FlutterInstall@0
displayName: 'Flutter Install'
- task: Hey24sheep.flutter.flutter-command.FlutterCommand@0
displayName: 'Flutter Command'
inputs:
projectDirectory: app
arguments: 'config --enable-web'
- task: Hey24sheep.flutter.flutter-command.FlutterCommand@0
displayName: 'flutter run build web'
inputs:
projectDirectory: app #{here put your source code folder}
arguments: 'build web'
- task: AzureStaticWebApp@0
displayName: "web"
inputs:
app_location: "app" #{here put your source code folder}
api_location: ""
# app_build_command: "flutter build web"
app_build_command: ""
output_location: "build/web"
env:
azure_static_web_apps_api_token: $(deployment-token-development)