Skip to content

Commit f958b1a

Browse files
authored
Create build.yml
1 parent 1b48beb commit f958b1a

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Commit dist
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'src/**'
8+
- 'package.json'
9+
- 'package-lock.json'
10+
workflow_dispatch: # 允许手动触发
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
24+
- run: npm install
25+
- run: npm run build
26+
27+
- name: Commit dist folder
28+
run: |
29+
git config user.name "github-actions[bot]"
30+
git config user.email "github-actions[bot]@users.noreply.github.com"
31+
git add dist/
32+
git diff --quiet && git diff --staged --quiet || git commit -m "build: update dist [skip ci]"
33+
git push

0 commit comments

Comments
 (0)