question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build files in git and Github Pages

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
loreanvictorcommented, Apr 29, 2020

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

1reaction
loreanvictorcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Pages | Websites for you and your projects, hosted ...
Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.
Read more >
Deploying to GitHub Pages - Codecademy
You can set up your GitHub Pages to deploy every one of your repositories in addition to <username>.github.io . This will allow you...
Read more >
How do I use GitHub Pages? - Learn web development | MDN
GitHub is a "social coding" site. It allows you to upload code repositories for storage in the Git version control system.
Read more >
GitHub and GitHub Pages - Stephanie Hicks
The purpose of GitHub Pages is to provide the GitHub user a way to create personal websites for themselves and websites for their...
Read more >
How to Upload Your Startup Website to GitHub Pages
If you are familiar with the Git version control system, then you can upload your website files to the repository in this way....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found