Files
drift/.github/workflows/copy_repo.yml
T
Mark Aron Szulyovszky 522757c282 fix(CI): push to the public repo without the private repo's history (#207)
* feat(CI): push to the public repo without the private repo's history

* fix(CI): workflow syntax

* fix(CI): use the destination ssh key

* fix(CI): wrong syntax

* fix(CI): taken out unnecessary step

* fix(CI): correct pipe syntax?

* fix(CI): create dictionary

* fix(CI): use global ssh config

* fix(CI): git config can be only called in a repo's dir

* fix(CI): clone the repo with ssh

* fix(CI): added ssh key when clonign

* fix(CI): don't build the docs on PRs

* fix(CI): use the correct ssh keys

* fix(CI): don't push to the local brunch

* fix(CI): missing chmod

* chore(CI): print out private key

* fix(CI): echo

* Update copy_repo.yml

* Update copy_repo.yml

* Update copy_repo.yml

* Update copy_repo.yml

* Update copy_repo.yml

* Update copy_repo.yml

* Update copy_repo.yml

* Update copy_repo.yml

* Update copy_repo.yml

* Update copy_repo.yml

* Update copy_repo.yml

* Create purge.yaml

* Update purge.yaml

* Update copy_repo.yml

* Update copy_repo.yml

* Delete purge.yaml
2022-02-08 01:07:16 +01:00

43 lines
1.4 KiB
YAML

name: Copy Repo, Strip Functions and Git Commit
on:
push:
branches:
- main
jobs:
Copy-Repo-Strip-Functions:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
activate-environment: strip
environment-file: environment-strip-action.yaml
python-version: 3.9
- name: Run empty function
shell: bash -l {0}
run: |
python -m libcst.tool codemod replace_functions.ReplaceFunctionCommand .
- name: Clone & push to public repo
shell: bash -l {0}
env:
DESTINATION_SSH_PRIVATE_KEY: ${{ secrets.DESTINATION_SSH_PRIVATE_KEY }}
run: |
git config --global user.name "bot"
git config --global user.email "mark.szulyovszky@gmail.com.com"
cd ..
mkdir -p ~/.ssh
echo "$DESTINATION_SSH_PRIVATE_KEY" | sed 's/\\n/\n/g' >~/.ssh/dst_rsa
chmod 600 ~/.ssh/dst_rsa
git clone -c core.sshCommand="/usr/bin/ssh -i ~/.ssh/dst_rsa" git@github.com:applied-exploration/drift.git
rsync -aP --exclude=.git/** ./drift-private/* ./drift/
cd drift
git config core.sshCommand "/usr/bin/ssh -i ~/.ssh/dst_rsa"
git add -A
git commit -m "update"
git push -u origin 'main'