From db83ff9ea6be0925f6a3e2c21f860d1d34162d86 Mon Sep 17 00:00:00 2001 From: Chris Anderson Date: Wed, 12 Apr 2023 07:56:21 -0500 Subject: [PATCH] Tags docker build with release tag (#122) Co-authored-by: Chris Hills <31041837+chrishills@users.noreply.github.com> --- .github/workflows/build.yml | 5 ++--- apps/platform/package.json | 2 +- apps/ui/package.json | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 989a2899..8b4eea4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,6 @@ name: Create & Publish Docker Image on: push: - branches: - - "main" tags: - "v*.*.*" @@ -34,4 +32,5 @@ jobs: - name: Build the Docker Image run: | - npm run docker:build:push + npm run docker:build:push --tag=$(echo ${GITHUB_REF_NAME:1}) + diff --git a/apps/platform/package.json b/apps/platform/package.json index 58b1fa73..a731ca79 100644 --- a/apps/platform/package.json +++ b/apps/platform/package.json @@ -52,7 +52,7 @@ "build": "tsc --build", "lint": "eslint --ext .ts --max-warnings 0 src/", "test": "jest --forceExit --runInBand --testTimeout 10000", - "docker:build": "docker buildx build -f ./Dockerfile -t ghcr.io/parcelvoy/api:latest ../../", + "docker:build": "docker buildx build -f ./Dockerfile -t ghcr.io/parcelvoy/api:latest -t ghcr.io/parcelvoy/api:$npm_config_tag ../../", "docker:build:push": "npm run docker:build -- --push", "migration:create": "node ./scripts/create-migration.mjs" }, diff --git a/apps/ui/package.json b/apps/ui/package.json index 78fb4003..1d9e39cc 100644 --- a/apps/ui/package.json +++ b/apps/ui/package.json @@ -40,7 +40,7 @@ "test": "react-scripts test", "eject": "react-scripts eject", "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"", - "docker:build": "docker buildx build -f ./Dockerfile -t ghcr.io/parcelvoy/ui:latest ../../", + "docker:build": "docker buildx build -f ./Dockerfile -t ghcr.io/parcelvoy/ui:latest -t ghcr.io/parcelvoy/ui:$npm_config_tag ../../", "docker:build:push": "npm run docker:build -- --push" }, "browserslist": {