Question

Web app deployment strategy

Background/Context

I’m running a WordPress site on a DO droplet whose static js and CSS are generated via gulp tasks. For those interested, I’ll leave the contents of my gulpfile below. My entire WordPress site is stored on Github and I’m using GitHub Webhooks to auto-deploy new commits that reach the repo to my DO server.

Problem

I use SASS to facilitate writing styles (for anyone unfamiliar, SASS compiles to pure CSS). This is done via the compile:sass task in my gulpfile. Today, I need to run gulp locally and commit the built CSS file (style.css) to my repo so that the changes end up on my server. This is a bad practice and one I’d like to change. In an ideal world, should my server be executing gulp every time it receives a message from GitHub’s webhook? Are there additional build processes that I should implement to make my setup more bulletproof?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

From what you describe, your only use for gulp is to compile the sass to css.

Therefore, if you drop to writing css, there won’t be any need to compile anything, which means gulp won’t be needed, right?

If that’s the case, then you’ll only need to copy over the changes to DO and that’ll be all, whenever you make changes.

You can run gulp commands via Github Actions if that is a must also, that way, you don’t need to run those commands on your machine everytime before you push to Github