cu-mkp / issue-tracker-archive

Website for cu-mkp manuscript-data issue tracker archive
0 stars 0 forks source link

use github actions/pages instead of manually deploying to a new branch #17

Open gschare opened 3 years ago

gschare commented 3 years ago

I'm not totally comfortable with the deploy.sh script we're using:

SITE_DIR="issue-tracker-archive/"
SITE_BRANCH="gh-pages"

bash update.sh
runhaskell build.hs

git add $SITE_DIR
git commit -m "Build site"
git push -d origin $SITE_BRANCH
git subtree push --prefix $SITE_DIR origin $SITE_BRANCH
git reset HEAD~1

This feels unstable because it somewhat abuses Git commits in order to get it to work. Of course, the reason why this appears to be necessary is that GitHub pages only allows us to host the site either using their Jekyll integration or simply by making the entire repo public, which is not what we want. We want to generate a folder of static files and then serve just that folder, and the code above does that by sending the generated folder to a new branch, pushing that branch, and then resetting to before it was generated. I wonder if there is a clean way to achieve this using GitHub Actions. This would be simple if it was clear by what process GitHub takes the content in the repo and deploys it, but alas I cannot find useful documentation for how to wrangle GitHub Pages deployment in the way that we need. Actually, the simplest way would be if GitHub allowed us to choose a particular folder to serve from, but for reasons I do not understand, we are only allowed to serve from root or /docs. Of course, we could just serve from /docs... but that also feels like a workaround when there must be a way to do this simply! In the meantime we can continue with the deployment script.