DEV Community

Cover image for Creating GitHub build for JavaScript projects
muncey
muncey

Posted on

3 1

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

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay