Example implementation of Node + Express JS webapp setup that utilizes GitHub actions to build and test the project, using Docker for containerization.
The pipeline has three main stages:
- Checkout repo and set up node.js + dependencies
- Build the docker image
- Run tests via
npm test
on the built image - If successful, push the docker image
The associated GH actions workflow manages building and pushing a new docker container on each push of the release/*
branch in accordance with git flow.
You can clone the repo, then set the below secret values:
- DOCKER_IMAGE_NAME = name of image to push (it will tag with the commit SHA)
- DOCKER_USERNAME = your dockerhub username
- DOCKER_TOKEN = PAT for dockerhub