Skip to content

Commit 4f3dc2d

Browse files
Update dart.yml
1 parent 8409e51 commit 4f3dc2d

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

.github/workflows/dart.yml

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
6-
name: Dart
1+
name: Flutter Web Build and Deploy
72

83
on:
94
push:
@@ -12,31 +7,27 @@ on:
127
branches: [ "master" ]
138

149
jobs:
15-
build:
10+
build-and-deploy:
1611
runs-on: ubuntu-latest
1712

1813
steps:
14+
# 检出代码
1915
- uses: actions/checkout@v4
2016

21-
# Note: This workflow uses the latest stable version of the Dart SDK.
22-
# You can specify other versions if desired, see documentation here:
23-
# https://github.com/dart-lang/setup-dart/blob/main/README.md
24-
# - uses: dart-lang/setup-dart@v1
17+
# 设置 Dart/Flutter 环境
2518
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603
2619

20+
# 安装依赖项
2721
- name: Install dependencies
28-
run: dart pub get
29-
30-
# Uncomment this step to verify the use of 'dart format' on each commit.
31-
# - name: Verify formatting
32-
# run: dart format --output=none --set-exit-if-changed .
33-
34-
# Consider passing '--fatal-infos' for slightly stricter analysis.
35-
- name: Analyze project source
36-
run: dart analyze
37-
38-
# Your project will need to have tests in test/ and a dependency on
39-
# package:test for this step to succeed. Note that Flutter projects will
40-
# want to change this to 'flutter test'.
41-
- name: Run tests
42-
run: dart test
22+
run: flutter pub get
23+
24+
# 构建 Flutter Web 项目
25+
- name: Build Flutter Web
26+
run: flutter build web --release
27+
28+
# 部署到 GitHub Pages
29+
- name: Deploy to GitHub Pages
30+
uses: peaceiris/actions-gh-pages@v4
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: build/web

0 commit comments

Comments
 (0)