I’ve been moving many repositories over to GitHub Actions to automate deployment and testing. One of my projects uses GitHub Pages, but includes data from two different branches:
- The
main
branch contains the bulk of the website - The
app-challenge
branch contains a second site that appears under a/heleon/
path
Using GitHub Actions, I set up the site pull from both branches before deploying. The script looks like this:
The first sequence of steps checks out the main
branch, installs Node.js and npm dependencies, then runs the build script. The files created by the build script end up in a folder named big-island-buses
.
The second sequence checks out the app-challenge
branch, and places the files inside a folder named heleon
, which is a subfolder of big-island-buses
. These files are static so they don’t have a separate build script.
However, putting one git repository inside another like this creates problems for the GitHub Pages script. Deleting the .git
folder turns the git repository into a plain folder.