Skip to content

Conversation

@spier
Copy link
Member

@spier spier commented Sep 15, 2025

Fixes #570. (or at least tries to ... again ;))

I am trying again to fix the GHA workflow that takes a screenshot of the mindmap that is rendered in our online book.
Previous failed tries were #571 and #775.

Found this here that can take screenshots on the CLI:
https://github.com/sindresorhus/pageres-cli

Could not find a GHA that wraps this but it was easy enough to express this in a workflow myself.

TODO:

  • once this PR is merged, remember to delete all the old branches of the closed PRs referenced above
  • possibly post an update on the old GHA that I used, to point users to pageres-cli

@spier spier added Type - Maintenance / Cleanup Maintaining / cleaning the repo is the main focus of this issue / PR (Self-) Hosting Everything around artifact rendering and presentation. labels Sep 15, 2025
@spier
Copy link
Member Author

spier commented Sep 15, 2025

The screenshot generation works now.

However the "Commit Changes" step does not work, as multiple matrix builds are trying changing the state of the repository in parallel. The git-auto-commit-action GHA explicitly mentions this limitation.

One way to solve this would be to upload the screenshots as artefacts in the matrix build, then at the end have a single job that downloads all artefacts and commits them. See stefanzweifel/git-auto-commit-action#290 and https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/run-job-variations#using-an-output-to-define-two-matrices

@spier
Copy link
Member Author

spier commented Sep 26, 2025

I tried a configuration where only one job of this workflow can run at the same time. i.e. switching off concurrency for this workflow entirely.

However even then it returns an error:
"Updates were rejected because the remote contains work that you do not have locally." I don't get it :(

@spier
Copy link
Member Author

spier commented Sep 27, 2025

Since f4ad3fb the execution is working.

All jobs of the matrix build are running sequentially now (aside: the whole concurrency config could be removed now)

Each of these jobs takes 30sec though, so in total the workflow takes 2 minutes, which is quite long.

I am considering to put it all in a single script that loops over all folders below "pattern-categorization" and calls the required clis to generate the markmap, take the screenshot, etc.

@spier
Copy link
Member Author

spier commented Sep 27, 2025

YES, finally!

Instead of using a GHA matrix build, I ended up with this approach:

  • Created a single script that loops over all folders below "pattern-categorization".
  • Then calls the required clis to generate the markmap, take the screenshot, etc.
  • At the end there is a single commit, pushing all changes to the repo (this way there cannot be any issues with the repo being out of sync with what is on the branch)

@spier spier merged commit 2971543 into main Sep 27, 2025
9 checks passed
@spier spier deleted the screenshot-mindmap-pageres branch September 27, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

(Self-) Hosting Everything around artifact rendering and presentation. Type - Maintenance / Cleanup Maintaining / cleaning the repo is the main focus of this issue / PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix generate-mindmap GHA workflow

2 participants