Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build files in git and Github Pages #5

Closed
LukasForst opened this issue Apr 28, 2020 · 7 comments
Closed

build files in git and Github Pages #5

LukasForst opened this issue Apr 28, 2020 · 7 comments
Assignees

Comments

@LukasForst
Copy link

Hi,
I like your work, awesome job! I wanted to setup a simple blog with my code and I noticed that node_modules have to be commited in the repo, which is something that I don't like (at least because of the size of the repo).

As I'm using Github Pages to host the blog I created Github Action pipeline, that takes the repo without node_modules, builds it and deploys it to the separate branch gh-pages. The benefit is that you don't have node_modules and html files, that are automatically generated, in your source code, but rather in the separate branch.

I think it is an elegant solution, so I just wanted someone know, that it is possible not to commit node_modules to the repo and utilize github actions instead.

@loreanvictor
Copy link
Contributor

loreanvictor commented Apr 28, 2020

while you do need to have the html files on GitHub somehow (either on the master branch or on the gh-pages branch), you definitely DO NOT NEED the node_modules to be there. This is the repo for the documentation for codedoc, built using codedoc itself, and this is another example built using codedoc and hosted on GitHub pages, both on master branch, none having node_modules (or .codedoc/node_modules) on the repo.

that said, using GitHub Actions to not have the html files directly on the master branch itself is a pretty nice idea. I have been meaning to get around to it but couldn't find the time (I mean codedoc itself is just released less than a week ago), so kudos for the nice solution! I'll modify the issue title to properly reflect that (from node_modules in git and GitHub Pages to build files in git and GitHub Pages).

P.S. you don't need the cd .codedoc && npm install line. You can simply install codedoc cli beforehand and run codedoc update or codedoc u.

@loreanvictor loreanvictor changed the title node_modules in git and Github Pages build files in git and Github Pages Apr 28, 2020
@loreanvictor
Copy link
Contributor

loreanvictor commented Apr 28, 2020

this solution resolves the issue. keeping it open until it is also added to the official documentation.

@LukasForst
Copy link
Author

Agggr, you're right about node_modules, my bad, I'm not frontend dev, sorry!

About the - cd .codedoc && npm install, I think that, in this case, the version of all libraries including codedoc remains same as during the local development thanks to the package-lock.json. Whereas using codedoc update can result in updating the libraries, no? If this is the case, I would propose to stick with npm install as if the pipeline would update libraries, it can potentially change some behavior or break something. However, if the commands are equal in terms of updating libraries, it is probably better to use codedoc update. (again, not frontend developer, so not sure whether I got this right)

@loreanvictor
Copy link
Contributor

thats a good point, so lets keep it as is. since that affects people collaborating on some documentation together as well, I think for convenience I'll add an install command to CLI as well, which will just install packages instead of updating everything.

@loreanvictor
Copy link
Contributor

it turns out there was a race condition for creating the assets folder which sometimes caused some assets not to be created during the build process. should be fixed by this, deployed via @codedoc/core@0.1.36

@loreanvictor
Copy link
Contributor

added this section to official docs as well for how to achieve this. again, @LukasForst thanks for the neat solution!

@LukasForst
Copy link
Author

Thanks! One last thing, you misspelled my name 😄, no biggie though

proposed by Lukas Frost, is to put all

should be

proposed by Lukas Forst, is to put all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants