File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build and Commit
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ branches :
9+ - main
10+ workflow_dispatch :
11+
12+ permissions :
13+ contents : write # Required for committing changes
14+
15+ jobs :
16+ build-and-commit :
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v4
21+ with :
22+ fetch-depth : 0 # Fetch all history for proper versioning
23+
24+ - name : Setup Node.js
25+ uses : actions/setup-node@v4
26+ with :
27+ node-version : ' 20'
28+ cache : ' yarn'
29+
30+ - name : Install dependencies
31+ run : yarn install
32+
33+ - name : Build package
34+ run : yarn prepare
35+
36+ - name : Configure Git
37+ run : |
38+ git config --global user.name 'GitHub Actions'
39+ git config --global user.email 'github-actions@github.com'
40+
41+ - name : Commit build results
42+ run : |
43+ git add build/
44+ git diff --quiet && git diff --staged --quiet || (git commit -m "chore: update build files [skip ci]" && git push)
You can’t perform that action at this time.
0 commit comments