Early this year, I worked on a Vue and Supabase project template and I thought it’d be a good idea to automate a few steps, as the community accepts as best practices.
I’ll describe two of them to showcase how to use GitHub actions to perform those steps automatically when a triggering event occurs on my repository.
Check that Code Builds
Often, we implement a best practice to have some automation to check that code pushed to a repository works for everyone.
Hence, when a programmer submits a pull request to merge his code modifications to the develop branch and to guarantee his branch builds with success, we trigger a build automatically and it’ll run the appropriate build command for the project.
On my project, I need to run npm run build.
The Trigger
In GitHub actions, you define the trigger as follows.
|
|
It targets the develop branch in the context of a pull request. It triggers only on opened or reopened pull requests. It also triggers when some new code is pushed to the feature branch we want to merge to develop only while a pull request exists between the two. This latter use case often occurs when developers review each other’s code and suggest code updates.
The Steps
Next, we define the steps to run:
- The Checkout code step pulls the repository’s code into the workflow runner.
- The Setup Node.js step installs the latest LTS version of Node.js and enables npm caching for faster installs.
- The Install dependencies step installs all required npm packages using
npm cifor a clean, reproducible setup. - The Run build steps executes the project’s build process using
npm run build.
|
|
Test It
Create a YAML file pr-build.yml containing the snippets described above into a folder .github/workflows at the root of your project.
Then push the feature branch and create a pull request. It should trigger the GitHub Action.
Create a Semantic Release
This workflow requires a more complex setup, but I’ll guide you through it, step by step as usual.
Stay tuned!
I’ve planned an article about Semantic Realase topic in February 2026. It’ll complement well to this GitHub Action.
For now, let me comment in the YAML code below the important parts:
|
|
Stay tuned for the full details to set up the project with a semantic release and configure it to your needs. The article is scheduled for February 9, 2026.
Conclusion
You can do a lot more with GitHub Actions, but this is a good start!
What do you use GitHub Actions for your day-to-day tasks?
Follow me
Thanks for reading this article. Make sure to follow me on X, subscribe to my Substack publication and bookmark my blog to read more in the future.
Photo by Pixabay.