DEV Community

Cover image for Automatically Deploying Nuxt.js + Express app on Now
Maksim Surguy
Maksim Surguy

Posted on β€’ Edited on

2 1

Automatically Deploying Nuxt.js + Express app on Now

I published a demo project that can help you understand deployment environments on Now.sh and how to automatically push to those environments using Github Actions.

Here's the link to the project: https://github.com/msurguy/nuxt-express-now

More about the repository:

The project has minimal structure to it, but it achieves the goals of demonstrating automatic deployments. It:

  • Uses latest stable version of Nuxt and Express (currently Nuxt 2.9.2)
  • Uses API endpoint from the ENV file (or from Now.json files)
  • Uses Github actions to deploy when a tag with a specific pattern is pushed
  • Uses ES6 in Node server code
  • Uses basic auth that is conditionally enabled / disabled via env variable
  • Automatically trims old deployments (that are not aliased) once a week

Assumptions

  • The default branch is staging. All PRs in the project are made against that branch
  • When testing is done on staging and approved, PR is opened against master
  • When this project is automatically deployed via Now + Github integration (not through Github Action), it uses now.json as the config.

Here's the diagram of what's happening when you push certain tags to the Github repository:

Now and Nuxt and Express development

Hope you enjoy and share this project!

Image of Quadratic

Free AI chart generator

Upload data, describe your vision, and get Python-powered, AI-generated charts instantly.

Try Quadratic free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay