DEV Community

Cover image for Creating GitHub build for JavaScript projects
muncey
muncey

Posted on

Creating GitHub build for JavaScript projects

In this article I am showing what I have done to get an automated build running in GitHub to build a JavaScript library. The project uses rollup.js to perform the build and to build a bundled javascript file based on the contents of a src folder.

I have used the GitHub Actions feature to create a new build. This is done by creating a GitHub project and then once the JavaScript files are in the project on the server clicking the Actions tab which takes me to this screen:

actions

The next step is very simple, I click on Setup workflow under Node.js which results in GitHub creating a .yml file for the build for me. I then make a small change to the yaml file to support running the build using rollup. The change is to add rollup.config.js to the run: task as follows:

    - run: npm run build rollup.config.js --if-present
Enter fullscreen mode Exit fullscreen mode

Once this is done if you wait about 2-3 minutes you can then click on the Actions tab again to review the results of the build. If all is good you should see something similar to the following:

Alt Text

Finally the project can be found here if you are interested in viewing the code:

GitHub logo muncey / MyJavascriptCMS

My Javascript CMS demonstration of building a CMS with pure Javascript and .NET

MyJavascriptCMS

My Javascript CMS demonstration of building a CMS with pure Javascript and .NET

Top comments (0)