Skip to content

Commit 62eafc4

Browse files
committed
Add sync workflow to EasyLibrary
1 parent fef7e82 commit 62eafc4

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Sync to EasyLibrary
2+
3+
on:
4+
push:
5+
branches: [development]
6+
paths:
7+
- 'src/imperazim/form/**'
8+
9+
jobs:
10+
sync:
11+
if: "!contains(github.event.head_commit.message, '[sync]')"
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout LibForm
16+
uses: actions/checkout@v4
17+
with:
18+
path: standalone
19+
20+
- name: Checkout EasyLibrary
21+
uses: actions/checkout@v4
22+
with:
23+
repository: ImperaZim/EasyLibrary
24+
ref: development
25+
token: ${{ secrets.SYNC_TOKEN }}
26+
path: easylibrary
27+
28+
- name: Sync files
29+
run: |
30+
SRC="standalone/src/imperazim/form"
31+
DEST="easylibrary/src/imperazim/form"
32+
33+
rm -rf "$DEST"
34+
mkdir -p "$DEST"
35+
36+
rsync -av --exclude='LibForm.php' "$SRC/" "$DEST/"
37+
38+
- name: Commit and push
39+
run: |
40+
cd easylibrary
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
if git diff --quiet && git diff --cached --quiet; then
44+
echo "No changes to sync"
45+
exit 0
46+
fi
47+
git add src/imperazim/form/
48+
git commit -m "[sync] Update embedded LibForm from standalone"
49+
git push

0 commit comments

Comments
 (0)