build files in git and Github Pages
See original GitHub issueHi,
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:
- Created 3 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
added this section to official docs as well for how to achieve this. again, @LukasForst thanks for the neat solution!
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 havingnode_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 (fromnode_modules in git and GitHub Pages
tobuild 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 runcodedoc update
orcodedoc u
.