Skip to content

new update

new update #15

name: Sync foo-space
on:
push:
branches:
- submodules
workflow_dispatch:
env:
SOURCE_DIR: ./src/
TARGET_OWNER: larshinueber
TARGET_REPO: foo-space
TARGET_DIR: docs/source/_src_getting_started/_src_examples/notebooks/foopy-examples
USER_NAME: github-actions
USER_EMAIL: [email protected]
jobs:
sync:
# if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
env:
# BRANCH_NAME: man-repo-sync-${{ github.event_name == 'pull_request' && github.event.pull_request.number || 'dispatch' }}
GH_TOKEN: ${{ secrets.GH_PAT }}
steps:
# - name: Checkout source repository
# uses: actions/checkout@v4
- name: Checkout target repository
uses: actions/checkout@v4
with:
repository: ${{ env.TARGET_OWNER }}/${{ env.TARGET_REPO }}
token: ${{ secrets.GH_PAT }}
ref: submodules
# submodules: true
# path: ./${{ env.TARGET_REPO }}
- name: Fetch new commits
run: |
# git pull --recurse-submodules
# git submodule update --remote --recursive
# git submodule update --remote
# cd ${{ env.TARGET_DIR }}
# git checkout -b submodules
# git pull
# git status
# git submodule foreach git pull
git submodule update --init --recursive
git submodule update --recursive --remote
# git submodule update --remote
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Sync submodule changes"
# - name: Create new branch
# run: |
# bash .github/scripts/checkout_branch.sh ${{ env.TARGET_REPO }} ${{ env.BRANCH_NAME }} ${{ env.USER_EMAIL }} ${{ env.USER_NAME }}
# - name: Delete old files
# run: |
# rm -rf ${{ env.TARGET_DIR }}
# - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.11'
# - name: Copy new files
# run: |
# python .github/scripts/copy_notebooks.py ${{ env.SOURCE_DIR }} ${{ env.TARGET_DIR }}
# - name: Push changes
# run: |
# bash .github/scripts/commit_and_push.sh ${{ env.TARGET_REPO }} ${{ env.BRANCH_NAME }}
# - name: Create PR
# run: |
# bash .github/scripts/create_pr.sh ${{ env.TARGET_REPO }} ${{ env.BRANCH_NAME }}