0

I want to build a Semaphore CI pipeline that checks out my branch, builds some artifacts and pushes these to another branch.

Specifically I'm writing Sphinx docs, and when their source merges to main, I want to build the HTML docs in this pipeline, and push the HTML to another branch, which GitHub Pages will ingest and host.

I can't find any info in Semaphore's docs on how to push back to my git repository.

This is a relatively common use case, with all the main competitors offering easy execution:

Robbie
  • 11
  • 5
  • I know nothing of Semaphore CI itself, but in general *build products* should not be stored in a Git repository. Git is bad at that. Build products should be stored in what some call an "artifactory", a sort of library in which one stores, well, build products. That's the same idea, in many ways, as Git, but different in a couple of crucial ways, which is why Git is the wrong answer and some sort of artifactory is the right one. (I don't have any particular artifactory system in mind here but building one based on say Amazon S3 would be straightforward.) – torek Jun 26 '22 at 01:37
  • Having taken a *very* brief look at the Semaphore CI pages, I have the vague impression that their guys understand this as well, and hence don't support "push build products to Git" because they already know that's the wrong approach... – torek Jun 26 '22 at 01:38
  • My intention isn't to use git as a replacement artifact store, Github pages hosts a free static site for you by ingesting html from a docs folder. Sphinx let's you write your static site in markdown and generates the html for you. So pushing to the git branch is deployment rather than storage. – Robbie Jun 27 '22 at 06:59
  • Obviously this use case is Github specific. The main case I see for pushing back to git is pushing tags following a successful release build. I can't think of other use cases involving pushing to branches tbh – Robbie Jun 27 '22 at 07:00
  • Understood (joanis made the same point about github-pages and generated documentation). I think GitHub are doing this wrong myself, but it's understandable why they do that, and it's not a big deal when what's being generated is textual documentation. It's still "wrong" in a philosophical sense, though (I'd argue anyway). – torek Jun 27 '22 at 07:00
  • Look at this SO post: https://stackoverflow.com/a/18936804 - you should find the answer there. Other than that, I agree with @torek point of view. – skipi Jun 27 '22 at 12:27

0 Answers0