Skip to content

Commit f94d42e

Browse files
committed
ci: add GitHub Actions workflow for automated build and commit process
1 parent 89a10a8 commit f94d42e

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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)

0 commit comments

Comments
 (0)