-
-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (32 loc) · 1 KB
/
build.yaml
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
name: Build and Commit Changes
on:
workflow_dispatch:
jobs:
build-and-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js environment
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Build project using Webpack/Rollup
run: |
npm i
npm run build
- name: Commit and push changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add -A
git reset -- node_modules # Unstage the node_modules changes
if ! git diff --cached --quiet; then
git diff --cached --name-only | while read -r file; do
commit_message="Updated $file :inbox_tray:"
git commit -m "$commit_message" -- "$file"
done
git push
else
echo "No changes to commit."
fi