From a0d288057f5afe1ff6b6f48e488e9e26a13b9e39 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 28 Oct 2025 14:10:04 -0500 Subject: [PATCH] Add Docker Image build and Publish to workflow Adds docker:build and docker:publish npm scripts expects DOCKERID to contain the user/organization id for formatting the tag ( DOCKERID/hombrewery:version ) Add CircleCI test to ensure image still builds --- .circleci/config.yml | 3 +++ package.json | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fb239ceb3..bcdf362ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -88,6 +88,9 @@ jobs: - run: name: Test - Content Negotiation command: npm run test:content-negotiation + - run: + name: Test - Build Docker image + command: DOCKERID=circliciTest npm run docker:build workflows: build_and_test: diff --git a/package.json b/package.json index 666832db8..37b362bc8 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,9 @@ "phb": "node --experimental-require-module scripts/phb.js", "prod": "set NODE_ENV=production && npm run build", "postinstall": "npm run build", - "start": "node --experimental-require-module server.js" + "start": "node --experimental-require-module server.js", + "docker:build": "docker build -t ${DOCKERID}/homebrewery:$npm_package_version .", + "docker:publish": "docker login && docker push ${DOCKERID}/homebrewery:$npm_package_version" }, "author": "stolksdorf", "license": "MIT",