I'm working on a one touch blog deployment workflow, using source markdown files (Repo A) and a static site generator (Repo B).
I'm attempting to maintain source markdown files in Repository A while also including them as a submodule in Repository B.
My goal is to trigger a workflow in Repository A which checks out Repository B and builds the site. It should pull in the updates from Repository A as a submodule of Repo B, build the site, and publish it to the gh-pages branch of Repository B.
Issue: Despite setting up a GitHub Actions workflow in Repository A to pull submodule updates from Repository A upon pushes, the submodule updates are not being fetched as expected. The workflow seems to execute without errors, but it does not reflect the changes made in Repository A.
During the github workflow which is triggered by Repo A, after checking out Repo B, and then cding into the submodule that is Repo A within Repo B (cd $CONTENT_DIR below), when the shell script does a git remote --v I see that it is still looking at the quartz repo which is the static site generator, Repo B. Why doesn't it show the Repo A remotes since I am in this directory?. I need to update Repo B to get the new markdown file changes before building the site.
I thought doing the checkout of the Repo B with sumbodules: recursive took care of initializing the submodules and pulling down the most recent files from the remote.
Image showing action runner issue and other code
Left is the runner output. Middle is the workflow. Right is a shell script I am running during the workflow.
Key Points:
- Both repositories are set up correctly with the submodule relationship established.
- The workflow in Repository B is configured to use a personal access token with appropriate permissions to access and update Repository A.
- Debugging statements within the workflow suggest that the submodule update step is executing but not fetching the changes from Repository A.
I have seen something about the quirks of submodules and am thinking about ditching this way all together. The reason to use a submodule was to push the intermediate build step where I create a custom index.md
Note that this requires me to use the peaceiris/actions-gh-pages@v3 workflow to be able to deploy a github pages site to an external repo. But I actually have the deployment kind-of working, it is just not building the right files.
Resources
Here are the repos: Repo A (source files, with deploy.yml): https://github.com/smaroukis/til-source Repo B (static site generator, with Repo A as submodule in the "content" folder): https://github.com/smaroukis/quartz
Deploy.yaml file (in markdown source repo): https://github.com/smaroukis/til-source/blob/main/.github/workflows/deploy.yml Custom prebuild.sh script (in site generator repo): https://github.com/smaroukis/quartz/blob/main/_userscripts/prebuild.sh