#Make `build.zig` generate docs and commit to alternate git branch?
1 messages · Page 1 of 1 (latest)
One alternative would be to just commit zig-out/docs and point github pages to that. But I want other non zig generated html files as well.
Do you basically want the femit docs to be published to the repo pages?
Yep.
Well, I have a master and a docs on github.
Literally that in my repo lib wait
Cool
Just check the build zig, and the ci
Thanks for sharing! Checking it out now.
The lib can emit the docs and in the CI it deploys them
You would have to switch from the github pages to deploy from actions instead of branch
Interesting. Yea I was hoping to do it without needing github actions. i.e.
build.ziggenerates the docs,build.zigputszig-out/docsinto thedocsgit branch.build.zigdoesgit commitandgit pushwith thedocsbranch
(That way it doesnt have to be github.)
Oh well
You could, I just find it easier
You just need to copy the docs dir from zig-out/docs into the whole branch, which I used to have a repo like that but think migrated it to actions too
Yea, I could do it with github actions. They just don't always work for me.
Like right now, I have a few failing repos because the apt-get fails to get ffmpeg for the past few days.
I'll do it your way if I cant find another way.
Hmm I was gonna say submodules, but an option in your case would be git work trees? Probably
Create the empty docs branch and have it within zig out and make the build docs copy paste it there etc.
I also just had another idea. "git clone docs branch into a temp folder and copy the zig-out/docs into it"
Oh well xd
Just reading up on git worktree.
To instead work on an existing branch in a new worktree, use git worktree add <path> <branch>.
It does seem like you could clear zig-out/docs and "worktree" a docs branch into it. Thats neat. Ive never used it before though.
note: you can install files into alternate install prefixes using -p/--prefix
Switching to the docs branch removes the build.zig file itself
This is kind of sketchy, but the compiled build script is actually located in .zig-cache, so as long as that is not tracked by git, it should still be present if you switch branches out from underneath yourself (as well as docs would be copied from zig-out.zig-cache too)