Reality Bending LabNews › How to sync two folders in two separate GitHub repositories

How to sync two folders in two separate GitHub repositories

2021-10-31 · Methods · Dominique Makowski

The Problem

I have a personal website, stored in a GitHub repo (and hosted via GitHub pages), as well as a lab website (a "company" website, if you will). Both are fairly similar, as they are built using Wowchemy's academic theme. Importantly, there is a blog in the company website with posts, but I have one on my personal website too. What I would like is that every time I post something on my website, it gets automatically copied over to the company website. So that I don't have to manually maintain the content at two separate places.

The Solution

  1. The first step is to go to the settings of your GitHub account, to developer settings, and to personal access tokens. You have to generate a token, and tick the repo authorizations. Copy-paste the key.
  2. Go to the settings of the personal website repo (the source from which the content will be copied), to "Secrets", and add a new secret called "API_TOKEN_GITHUB" (with the key you just copied).
  3. Create a new GitHub action workflow such as this one. The things to change are the source_file, destination_repo and destination_folder.

🎉 Every time I push to my personal repo, the new content of one of the subfolders gets copied to another repo.

Notes


Thanks for reading! Do not hesitate to share this post.

Keep reading

Click to Open
Reality Bending Lab

Exploring the neuropsychology of reality and its distortions.

The Reality Bending Lab, led by Dominique Makowski at the University of Sussex in Brighton, UK, conducts world-leading research on reality perception, illusions, fake news, AI-beliefs, deception and its links with emotions, cognitive control and the Self. Using recording signals from the body (ECG, EDA…) and the brain (EEG), we analyse data using advanced modelling (Bayesian statistics, chaos theory, computational models) and develop open-source tools to improve neuropsychological science.

“Do not try to bend the spoon — that’s impossible. Instead, only try to realise the truth: there is no spoon. Then you'll see that it is not the spoon that bends, it is only yourself.”

People

Information

Where to find us

The Reality Bending Lab is based in the School of Psychology, at the University of Sussex in Brighton, UK.

Pevensey 1 - room 2B7, School of Psychology, University of Sussex, BN1 9QH

The University of Sussex campus in the South Downs University of Sussex crest

University of Sussex

Brighton is the sunniest city in the UK and, by some margin, its most cheerfully strange — on the sea, an hour from London. The University of Sussex sits just above it in the South Downs, and its School of Psychology is one of the largest and strongest in the country.

It is famous for its research on consciousness and interoception, with scientists like Anil Seth, Andy Clark, Zoltan Dienes and Hugo Critchley, its teaching of cutting-edge psychological methods (with stats rockstar Andy Field), its history of multidisciplinary research (arts and science), and its radical engagement in open and disruptive science.

Join this community

Hire us Join the Lab Like this website? See how to get yours