Skip to content

Commit 31a2473

Browse files
committed
fix: update workflows
1 parent c98831a commit 31a2473

3 files changed

Lines changed: 43 additions & 34 deletions

File tree

.github/workflows/dev.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,33 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13+
check_changes:
14+
runs-on: ubuntu-24.04
15+
outputs:
16+
locale_changed: ${{ steps.filter.outputs.locale }}
17+
docs_changed: ${{ steps.filter.outputs.docs }}
18+
src_changed: ${{ steps.filter.outputs.src }}
19+
steps:
20+
- uses: dorny/paths-filter@v2
21+
id: filter
22+
with:
23+
filters: |
24+
locale:
25+
- 'locale/​**​'
26+
docs:
27+
- 'docs/​**​'
28+
src:
29+
- 'src/**'
30+
- 'public/**'
31+
- 'scripts/**'
32+
- 'tests/**'
33+
- 'build.config.js'
34+
- 'pnpm-lock.yaml'
35+
1336
build:
37+
needs: check_changes
1438
runs-on: ubuntu-24.04
39+
if: ${{ needs.check_changes.outputs.src_changed == 'true' }}
1540
strategy:
1641
matrix:
1742
node-version: [18.x]
@@ -76,12 +101,9 @@ jobs:
76101
# !temp/release/*-id.txt
77102

78103
sync-locale:
104+
needs: check_changes
79105
runs-on: ubuntu-24.04
80-
if: |
81-
github.event_name == 'push' &&
82-
contains(github.event.commits.*.added, 'locale') ||
83-
contains(github.event.commits.*.modified, 'locale') ||
84-
contains(github.event.commits.*.removed, 'locale')
106+
if: ${{ needs.check_changes.outputs.locale_changed == 'true' }}
85107
strategy:
86108
matrix:
87109
node-version: [18.x]
@@ -102,12 +124,9 @@ jobs:
102124
commit-message: '[skip ci] sync locale'
103125

104126
build-docs:
127+
needs: check_changes
105128
runs-on: ubuntu-24.04
106-
if: |
107-
github.event_name == 'push' &&
108-
contains(github.event.commits.*.added, 'docs') ||
109-
contains(github.event.commits.*.modified, 'docs') ||
110-
contains(github.event.commits.*.removed, 'docs')
129+
if: ${{ needs.check_changes.outputs.docs_changed == 'true' }}
111130
strategy:
112131
matrix:
113132
node-version: [18.x]

.github/workflows/main.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,22 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13+
check_changes:
14+
runs-on: ubuntu-24.04
15+
outputs:
16+
docs_changed: ${{ steps.filter.outputs.docs }}
17+
steps:
18+
- uses: dorny/paths-filter@v2
19+
id: filter
20+
with:
21+
filters: |
22+
docs:
23+
- 'docs/​**​'
24+
1325
build-docs:
26+
needs: check_changes
1427
runs-on: ubuntu-24.04
15-
if: |
16-
github.event_name == 'push' &&
17-
contains(github.event.commits.*.added, 'docs') ||
18-
contains(github.event.commits.*.modified, 'docs') ||
19-
contains(github.event.commits.*.removed, 'docs')
28+
if: ${{ needs.check_changes.outputs.docs_changed == 'true' }}
2029
strategy:
2130
matrix:
2231
node-version: [18.x]

docs/README.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1 @@
11
# Header Editor Docs
2-
3-
A static site base on [dumi](https://d.umijs.org).
4-
5-
## Development
6-
7-
```bash
8-
# install dependencies
9-
$ pnpm install
10-
11-
# start dev server
12-
$ pnpm start
13-
14-
# build docs
15-
$ pnpm run build
16-
```
17-
18-
## LICENSE
19-
20-
MIT

0 commit comments

Comments
 (0)