SciNim / getting-started

Getting started with Nim for Scientific Computing
https://scinim.github.io/getting-started/
Creative Commons Zero v1.0 Universal
61 stars 6 forks source link

Fix docs actions #29

Closed pietroppeter closed 3 years ago

pietroppeter commented 3 years ago

As experienced in nimibook (e.g. https://github.com/pietroppeter/nimibook/issues/30), current gh-actions for commiting and pushing new docs in gh-pages has problems when files are added and removed (since it is based on a rebase command). I tested https://github.com/peaceiris/actions-gh-pages in nimibook and it works well.

Changes needed on top of merging this:

HugoGranstrom commented 3 years ago

Wow thanks for sharing your experience with the beast that is the CI :D

Just to make it clear, is this the order of operations?

  1. Remove gh-pages branch
  2. Merge this
  3. Change root folder

Does this depend on #28 being merged first?

pietroppeter commented 3 years ago

Yeah that is a good order. No they are independent

HugoGranstrom commented 3 years ago

Alright! 👌 I'll fix and merge this tomorrow

HugoGranstrom commented 3 years ago

Have performed the steps now but gh-pages is empty 🤔

This was the correct setting, right? bild

HugoGranstrom commented 3 years ago

Or is it this .gitignore that is causing this? @Clonkk https://github.com/SciNim/getting-started/blob/29b3df41c33eaf683e202f0ce8646bd501f4cbd4/docs/.gitignore#L1

pietroppeter commented 3 years ago

yes, settings are good. that gitignore does not look good...

HugoGranstrom commented 3 years ago

Ok, should we add a manual rm docs/.gitignore then?

pietroppeter commented 3 years ago

I would remove it directly from main

HugoGranstrom commented 3 years ago

I think the reason we added it to begin with was to prevent accidentally commiting local files in docs/. Idk if it could cause any harm if we removed it directly or not.

Clonkk commented 3 years ago

Ah the github action you use do not add - f files.

Yes, the idea is to be able to build locally and avoid the mistakes of "git add .".

The git ignore can be removed as long as we're cautious : we can simply protect the main branch and require review before merging we're unlikely to miss a PR adding dozens of files (that's probably a better way of doing it).

pietroppeter commented 3 years ago

I see that in nimibook root folder the gitignore contains docs folder and the same actions runs fine. probably we can remove the gitognore in docs folder and add docs as an ignored folder in root gitgnore.

HugoGranstrom commented 3 years ago

I see that in nimibook root folder the gitignore contains docs folder and the same actions runs fine. probably we can remove the gitognore in docs folder and add docs as an ignored folder in root gitgnore.

I'd prefer this if it works

The git ignore can be removed as long as we're cautious : we can simply protect the main branch and require review before merging we're unlikely to miss a PR adding dozens of files (that's probably a better way of doing it).

We should probably add protection as well, do you know how to do it? @Clonkk

HugoGranstrom commented 3 years ago

Adding docs/ to the root .gitignore solved it 🥳

Clonkk commented 3 years ago

I added the rule that require CI to pass and at least one person approving a PR to be merged