Sync install.sh to website #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync install.sh to website | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'install.sh' # only triggers when install.sh actually changes | |
| workflow_dispatch: # lets you trigger it manually from GitHub UI | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout conductor repo | |
| uses: actions/checkout@v4 | |
| - name: Push install.sh to website repo | |
| env: | |
| TOKEN: ${{ secrets.WEBSITE_REPO_TOKEN }} | |
| run: | | |
| # --- config: update these two values --- | |
| WEBSITE_REPO="thealxlabs/conductor-website" # your website repo name | |
| DEST_PATH="install.sh" # path inside the website repo | |
| # --------------------------------------- | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| # Clone the website repo | |
| git clone https://x-access-token:${TOKEN}@github.com/${WEBSITE_REPO}.git website-repo | |
| # Copy the file | |
| cp install.sh website-repo/${DEST_PATH} | |
| cd website-repo | |
| # Only commit if something actually changed | |
| if git diff --quiet; then | |
| echo "No changes to install.sh, skipping commit." | |
| exit 0 | |
| fi | |
| git add ${DEST_PATH} | |
| git commit -m "sync: update install.sh from conductor@${{ github.sha }}" | |
| git push |