-
Notifications
You must be signed in to change notification settings - Fork 365
131 lines (124 loc) · 4.07 KB
/
Copy pathdocs.yml
File metadata and controls
131 lines (124 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Docs site
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'sites/docs/**'
- 'examples/**'
- 'packages/excerpter/**'
- 'firebase.json'
- 'tool/dash_site/**'
- 'tool/config/linkcheck-skip-list.txt'
- 'pubspec.yaml'
- 'pubspec.lock'
- 'analysis_options.yaml'
- '.github/workflows/docs.yml'
pull_request:
branches:
- main
paths:
- 'sites/docs/**'
- 'examples/**'
- 'packages/excerpter/**'
- 'firebase.json'
- 'tool/dash_site/**'
- 'tool/config/linkcheck-skip-list.txt'
- 'pubspec.yaml'
- 'pubspec.lock'
- 'analysis_options.yaml'
- '.github/workflows/docs.yml'
# schedule:
# - cron: '0 0 * * 0'
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
excerpts:
name: Check code excerpts
runs-on: ubuntu-latest
if: github.repository == 'cfug/flutter.cn'
timeout-minutes: 20
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
with:
sdk: beta
- name: Fetch Dart dependencies
run: dart pub get
- name: Check if excerpts are up to date
run: dart run dash_site --site=docs refresh-excerpts --fail-on-update --dry-run
linkcheck:
name: Build and check links
runs-on: ubuntu-latest
if: github.repository == 'cfug/flutter.cn'
timeout-minutes: 30
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
with:
sdk: beta
- name: Fetch Dart dependencies
run: dart pub get
- name: Install firebase-tools
run: curl -sL https://firebase.tools | bash
- name: Build site
run: dart run dash_site --site=docs build
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 24
- name: Translated (docs.flutter.cn)
run: bash tool/translator/build.sh
shell: bash
- name: Check for broken Markdown link references
run: dart run dash_site --site=docs check-link-references
- name: Check for broken internal links
run: dart run dash_site --site=docs check-links
firebase-validate:
name: Validate Firebase configuration
runs-on: ubuntu-latest
if: github.repository == 'cfug/flutter.cn'
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
with:
sdk: beta
- name: Fetch Dart dependencies
run: dart pub get
- name: Validate the firebase.json file
run: dart run dash_site --site=docs verify-firebase-json
deploy:
name: Deploy to production
needs: [excerpts, linkcheck, firebase-validate]
runs-on: ubuntu-latest
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
github.repository == 'cfug/flutter.cn'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
# docs.flutter.cn | https://github.com/cfug/flutter.cn/pull/1518
fetch-depth: 0
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
with:
sdk: beta
- name: Fetch Dart dependencies
run: dart pub get
- name: Build site
run: dart run dash_site --site=docs build --release
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 24
- name: Translated (docs.flutter.cn)
run: bash tool/translator/build.sh
shell: bash
- name: Deploy to production
run: bash tool/deploy/deploy-cn-docs.sh
shell: bash
env:
DEPLOY_USER: ${{ secrets.DOCS_REPO_DEPLOY_USER }}
DEPLOY_TOKEN: ${{ secrets.DOCS_REPO_DEPLOY_TOKEN }}