Created
February 1, 2020 03:31
-
-
Save oshimayoan/78ab48916f2d0b63d8062249f1c581f2 to your computer and use it in GitHub Desktop.
CircleCI config.yml for mirroring Github repo
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
version: 2.1 | |
jobs: | |
mirror: | |
docker: | |
- image: circleci/node:lts | |
steps: | |
- add_ssh_keys: | |
fingerprints: | |
- YOUR_FINGERPRINT_HERE | |
- run: | |
name: Prepare for mirroring | |
command: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Your Name" | |
# Need to create .ssh dir in case it doesn't exists | |
mkdir -p ~/.ssh | |
# This too | |
touch ~/.ssh/known_hosts | |
# To avoid prompt when doing ssh connection | |
ssh-keyscan 'github.com' >> ~/.ssh/known_hosts | |
- run: | |
name: Mirroring repo | |
command: | | |
git clone --bare [email protected]:oshimayoan/something.git | |
cd something.git | |
git push --mirror [email protected]:oshimayoan/something-mirror.git | |
workflows: | |
main: | |
jobs: | |
- mirror: | |
filters: | |
branches: | |
only: master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment