My source materials live in one git repo, and my website in another. After exporting any of my my courses to the local hugo directory, I'd like to run a shell script that I'll keep in my org-files directory.
That script
- cds to the website repo directory, commits changes to the website master branch, - runs hugo,
- switches to the "public" directory of compiled html pages, which has a worktree checked out to the gh-pages branch,
- commits changes there as well, and then
- pushes both branches to github.
The script seems to work OK, and now I would like to run it every time I export from the appropriate projects. Is there a good way for me to do this? I guess a hook that only runs under certain conditions?
If I can get this to work, and then also auto export every time I commit the org-files to master (maybe with a post-commit git hook of ~emacsclient -e '(org-publish-project "course1"~ ?), then I will maybe be almost happy!