![]() Reading down the comments in the gist show a number of other useful conditional triggers, like PHP's composer install, preprocessing of. # In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. # Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.Ĭhanged_files="$(git diff-tree -r -name-only -no-commit-id ORIG_HEAD HEAD)"Įcho "$changed_files" | grep -quiet "$1" & eval "$2" # git hook to run a command after `git pull` if a specified file was changed git/hooks directory with the following contents: It uses the GitHub Pages Action which pushes the generated files from the dist folder to your default GitHub Pages branch gh-pages. #Npm install from github branch softwareIt's probably time to automate this task.Ī quick Google search led me to a series of gists to use a git hook to trigger npm install if a package.json file has been updated. To deploy via GitHub Actions, the official tool for software automation with GitHub, if you dont have a workflow you need to create a new one or append a new step to your existing workflow. and then pushing it to a special branch in our GitHub repo. npm i webpack webpack-cli webpack-dev-server html-webpack-plugin style-loader css-loader. Instead I see npm start result in errors which leads to facepalm after facepalm. Lets install these dev dependencies as well. You would think by know I'd be used seeing the package.json file when I did a git pull and it would trigger something in my head to execute npm install to ensure I had the latest dependencies installed but I somehow continue to forget to do so. Most of the projects I work on these days contain a frequently-modified package.json file to manage dependencies.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |