Skip to content

GitHub Actions for running Javascript build tools and committing file changes

Notifications You must be signed in to change notification settings

ljharb/actions-js-build

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Actions for JavaScript build tools (Gulp, Grunt, NPM -- and git)

Run JS build tasks with Gulp, Grunt or NPM, then commit any changed files and push them back to your original repository.

Perfect for Grunt or Gulp tasks that do CSS (or SASS/LESS) compilation or JS transpilation. If your build task changes files, these actions are for you.

This repository contains two actions that may be used independently -- typically one after another:

  • build (elstudio/actions-js-build/build@v2): Looks for a gulpfile.js or Gruntfile.js in the working directory, then installs any required npm packages and runs the appropriate build tool. If it finds neither gulp or grunt, the script runs npm. Set the workflow args arguments to run the tasks of your choice.
  • commit (elstudio/actions-js-build/commit@v3): Commits any file changes, and pushes them back to the current branch of the origin repository on GitHub.

Usage

An example workflow to run grunt default task to build, test, then commit and push any changes back to the GitHub origin repository:

name: Grunt build and commit updated stylesheets

on: [push]

jobs:
  grunt-build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Compile with Grunt
      uses: elstudio/actions-js-build/build@v2
      with:
        wdPath: './web/themes/nw8'

    - name: Commit changes
      uses: elstudio/actions-js-build/commit@v3
      with:
        commitMessage: Regenerate css 

Inputs

  • wdPath - Optional. To specify a directory other than the repository root where NPM's Package.json and either gulpfile.js or Gruntfile.js may be found.

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

Container images built with this project include third party materials. See THIRD_PARTY_NOTICE.md for details.

About

GitHub Actions for running Javascript build tools and committing file changes

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 47.5%
  • Dockerfile 29.7%
  • HCL 22.8%