Backup GitHub repositories locally.
- Create a new personal access token with
reposcope; - Create
gh.secretand put your token inside; - Set
GHBACKUP_PATHenv variable to set the backup path; mix run
Make a ssh key to clone the repositories in the ssh_keys folder.
ssh-keygen -t ed25519 -C "your_email@example.com" -f ./ssh_keys/id_ed25519 -q -N ""Add the key to your GitHub account.
Build and run the docker with:
docker build -t ghback .
docker run -d --rm -v <path/to/backup>:/usr/app/backup ghback