Deploying static sites with GitHub Actions and Netlify

- 4 mins
…and a hack to turn that PHP site into a static one


For the last few months, has been going through a rebranding process, that included a brand-new website developed by the awesome team at Twotwentytwo. The finished product that they have received was a site developed in Php with some Node.js built assets. But internally we have decided that we really want a static site and to keep using Netlify as everyone has been very happy with it.

The solution

Because the website’s code was already hosted on GitHub, GitHub’s new Actions feature seemed like the best fit for their CI / CD needs: it supports all types of steps that are required and it is already baked into GitHub, I just needed to enable the feature.

The steps

After enabling actions on the website’s GitHub repo, I could get to work at defining theworkflow, in GitHub’s lingo, what other solutions would call a pipeline. The first step was to create a .github/workflows/main.yml that would hold this deploy-to-Netlify workflow.

That’s it! Save the workflow file .yml file, push and commit it to GitHub and it should trigger a GitHub action that will do all the work for you from now on and regenerate and redeploy the website at every commit to the master branch.

rss facebook twitter github youtube mail spotify instagram linkedin google pinterest medium tumblr soundcloud blog