Skip to content

Update dart.yml

Update dart.yml #3

Workflow file for this run

name: Flutter Web Build and Deploy
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# 检出代码
- uses: actions/checkout@v4
# 设置 Flutter 环境
- uses: subosito/flutter-action@v2
with:
flutter-version: "stable"
# 安装依赖项
- name: Install dependencies
run: flutter pub get
# 构建 Flutter Web 项目
- name: Build Flutter Web
run: flutter build web --release
# 部署到 GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/web