Apply automatic changes #1
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: Deploy to target repository | |
on: | |
workflow_dispatch: | |
push: | |
branches: ['master'] | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
if: github.repository == 'BMCV/mobi-fs3-python-dev' | |
steps: | |
- name: Checkout source repository | |
uses: actions/checkout@v4 | |
with: | |
path: src | |
- name: Checkout target repository | |
uses: actions/checkout@v4 | |
with: | |
repository: BMCV/mobi-fs3-python | |
path: dst | |
fetch-depth: 1 | |
ssh-key: ${{ secrets.TARGET_REPOSITORY_PRIVATE_KEY }} | |
- name: Copy files | |
shell: python | |
run: | | |
import shutil | |
ignore = shutil.ignore_patterns( | |
'.git', | |
'.github/dependabot.yml', | |
'.github/workflows/deploy.yml', | |
'_solutions', | |
'_deploy', | |
) | |
shutil.copytree('src', 'dst', ignore=ignore, dirs_exist_ok=True) | |
shutil.copytree('src/_deploy', 'dst', dirs_exist_ok=True) | |
- name: Squash and deploy | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_options: '--amend --no-edit' | |
push_options: '--force' | |
skip_fetch: true | |
repository: dst | |