1- name : build
1+ name : Docs site
22
33on :
44 push :
55 branches :
66 - main
7+ paths :
8+ - ' sites/docs/**'
9+ - ' examples/**'
10+ - ' packages/excerpter/**'
11+ - ' firebase.json'
12+ - ' tool/dash_site/**'
13+ - ' tool/config/linkcheck-skip-list.txt'
14+ - ' pubspec.yaml'
15+ - ' pubspec.lock'
16+ - ' analysis_options.yaml'
17+ - ' .github/workflows/docs.yml'
718 pull_request :
819 branches :
920 - main
21+ paths :
22+ - ' sites/docs/**'
23+ - ' examples/**'
24+ - ' packages/excerpter/**'
25+ - ' firebase.json'
26+ - ' tool/dash_site/**'
27+ - ' tool/config/linkcheck-skip-list.txt'
28+ - ' pubspec.yaml'
29+ - ' pubspec.lock'
30+ - ' analysis_options.yaml'
31+ - ' .github/workflows/docs.yml'
32+ # schedule:
33+ # - cron: '0 0 * * 0'
1034
11- # Declare default permissions as read only.
1235permissions : read-all
1336
14- jobs :
15- test :
16- name : Analyze and test code examples
17- runs-on : ubuntu-latest
18- if : github.repository == 'cfug/flutter.cn'
19- strategy :
20- fail-fast : false
21- matrix :
22- include :
23- - name : " Beta channel"
24- branch : beta
25- experimental : false
26- - name : " Stable channel"
27- branch : stable
28- experimental : true
29- continue-on-error : ${{ matrix.experimental }}
30- steps :
31- - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
32- - uses : subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
33- with :
34- channel : ${{ matrix.branch }}
35- - name : Fetch Dart dependencies
36- run : dart pub get
37- continue-on-error : ${{ matrix.experimental }}
38- - name : Check Dart code formatting
39- run : dart run dash_site format-dart --check
40- continue-on-error : ${{ matrix.experimental }}
41- - name : Analyze Dart code
42- run : dart run dash_site analyze-dart
43- continue-on-error : ${{ matrix.experimental }}
44- - name : Run Dart tests
45- run : dart run dash_site test-dart
46- continue-on-error : ${{ matrix.experimental }}
37+ concurrency :
38+ group : ${{ github.workflow }}-${{ github.ref }}
39+ cancel-in-progress : ${{ github.event_name == 'pull_request' }}
4740
41+ jobs :
4842 excerpts :
49- name : Check if code excerpts are up to date
43+ name : Check code excerpts
5044 runs-on : ubuntu-latest
5145 if : github.repository == 'cfug/flutter.cn'
46+ timeout-minutes : 20
5247 steps :
5348 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
5449 - uses : dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
@@ -57,14 +52,13 @@ jobs:
5752 - name : Fetch Dart dependencies
5853 run : dart pub get
5954 - name : Check if excerpts are up to date
60- run : dart run dash_site refresh-excerpts --fail-on-update --dry-run
61- continue-on-error : ${{ matrix.experimental }}
55+ run : dart run dash_site --site=docs refresh-excerpts --fail-on-update --dry-run
6256
6357 linkcheck :
64- name : Build site and check links
58+ name : Build and check links
6559 runs-on : ubuntu-latest
66- timeout-minutes : 30
6760 if : github.repository == 'cfug/flutter.cn'
61+ timeout-minutes : 30
6862 steps :
6963 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
7064 - uses : dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
@@ -73,24 +67,25 @@ jobs:
7367 - name : Fetch Dart dependencies
7468 run : dart pub get
7569 - name : Install firebase-tools
76- run : curl -sL https://firebase.tools/ | sed s/latest/v15.2.1/ | bash
70+ run : curl -sL https://firebase.tools | bash
7771 - name : Build site
78- run : dart run dash_site build
79- - uses : actions/setup-node@670825a89dc0abd596e7a3abd0f5e3f6e5faf37c
72+ run : dart run dash_site --site=docs build
73+ - uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
8074 with :
8175 node-version : 24
8276 - name : Translated (docs.flutter.cn)
8377 run : bash tool/translator/build.sh
8478 shell : bash
8579 - name : Check for broken Markdown link references
86- run : dart run dash_site check-link-references
80+ run : dart run dash_site --site=docs check-link-references
8781 - name : Check for broken internal links
88- run : dart run dash_site check-links
82+ run : dart run dash_site --site=docs check-links
8983
9084 firebase-validate :
9185 name : Validate Firebase configuration
9286 runs-on : ubuntu-latest
9387 if : github.repository == 'cfug/flutter.cn'
88+ timeout-minutes : 10
9489 steps :
9590 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
9691 - uses : dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
@@ -99,11 +94,11 @@ jobs:
9994 - name : Fetch Dart dependencies
10095 run : dart pub get
10196 - name : Validate the firebase.json file
102- run : dart run dash_site verify-firebase-json
97+ run : dart run dash_site --site=docs verify-firebase-json
10398
10499 deploy :
105100 name : Deploy to production
106- needs : [test, excerpts, linkcheck, firebase-validate]
101+ needs : [excerpts, linkcheck, firebase-validate]
107102 runs-on : ubuntu-latest
108103 if : |
109104 github.event_name == 'push' &&
@@ -120,8 +115,8 @@ jobs:
120115 - name : Fetch Dart dependencies
121116 run : dart pub get
122117 - name : Build site
123- run : dart run dash_site build --release
124- - uses : actions/setup-node@670825a89dc0abd596e7a3abd0f5e3f6e5faf37c
118+ run : dart run dash_site --site=docs build --release
119+ - uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
125120 with :
126121 node-version : 24
127122 - name : Translated (docs.flutter.cn)
0 commit comments