Skip to content

Commit 070cc94

Browse files
authored
Create sync-install.yml
1 parent 31036f0 commit 070cc94

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

‎.github/workflows/sync-install.yml‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Sync install.sh to website
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'install.sh' # only triggers when install.sh actually changes
9+
workflow_dispatch: # lets you trigger it manually from GitHub UI
10+
11+
jobs:
12+
sync:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout conductor repo
16+
uses: actions/checkout@v4
17+
18+
- name: Push install.sh to website repo
19+
env:
20+
TOKEN: ${{ secrets.WEBSITE_REPO_TOKEN }}
21+
run: |
22+
# --- config: update these two values ---
23+
WEBSITE_REPO="thealxlabs/conductor-website" # your website repo name
24+
DEST_PATH="install.sh" # path inside the website repo
25+
# ---------------------------------------
26+
27+
git config --global user.name "github-actions[bot]"
28+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
29+
30+
# Clone the website repo
31+
git clone https://x-access-token:${TOKEN}@github.com/${WEBSITE_REPO}.git website-repo
32+
33+
# Copy the file
34+
cp install.sh website-repo/${DEST_PATH}
35+
36+
cd website-repo
37+
38+
# Only commit if something actually changed
39+
if git diff --quiet; then
40+
echo "No changes to install.sh, skipping commit."
41+
exit 0
42+
fi
43+
44+
git add ${DEST_PATH}
45+
git commit -m "sync: update install.sh from conductor@${{ github.sha }}"
46+
git push

0 commit comments

Comments
 (0)