ci: update #6
Workflow file for this run
This file contains 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: Split Monorepo | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- mtd/split | |
# schedule: | |
# - cron: '0 2 * * 0' # Run weekly on Sunday at 2 AM (adjust as needed) | |
jobs: | |
split-repo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Monorepo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# - name: Install git-filter-repo | |
# run: | | |
# curl -Lo /usr/local/bin/git-filter-repo https://raw.githubusercontent.com/newren/git-filter-repo/main/git-filter-repo | |
# chmod +x /usr/local/bin/git-filter-repo | |
- name: Set Up Git | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Split Backend Repo | |
env: | |
BACKEND_REPO_URL: https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/${{ vars.BACKEND_REPO }}.git | |
run: | | |
echo "Splitting backend repo" | |
echo "Backend Repo URL: $BACKEND_REPO_URL" | |
cd backend | |
git init | |
git add . | |
git commit -m "Update backend" | |
git remote add backend $BACKEND_REPO_URL | |
git push --force backend main | |
# - name: Split Frontend Repo | |
# env: | |
# FRONTEND_REPO_URL: https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/${{ secrets.FRONTEND_REPO }}.git | |
# run: | | |
# # Clone only the frontend directory with history | |
# git clone --no-checkout $GITHUB_SERVER_URL/$GITHUB_REPOSITORY frontend-split | |
# cd frontend-split | |
# git filter-repo --path frontend/ --path-rename frontend/:/ | |
# git remote add frontend $FRONTEND_REPO_URL | |
# git push --force frontend main |