From 69f39b2788f347edd236192d48ef03b3b1214b83 Mon Sep 17 00:00:00 2001 From: Thomas Schaffter Date: Thu, 21 Nov 2024 21:23:18 -0800 Subject: [PATCH] fix(sage-monorepo): update task `build-image` configurations (#2919) --- .github/workflows/ci.yml | 3 +-- .github/workflows/release.yml | 2 +- .../nx-plugin/src/plugins/build-image-target.ts | 12 +++++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad61200ff..8aef9a41c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,9 +65,8 @@ jobs: - name: Build and publish the images of the affected projects run: | devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \ - && export VERSION=edge \ && echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin \ - && nx affected --target=build-image --configuration=ci" + && nx affected --target=build-image --configuration=edge" - name: Remove the dev container run: docker rm -f sage_devcontainer diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d07a710b..5e234cc88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,4 +44,4 @@ jobs: devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \ && export VERSION=${{ env.VERSION }} \ && echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin \ - && nx run-many --target=build-image --projects=${{ env.PRODUCT }}-* --configuration=ci" + && nx run-many --target=build-image --projects=${{ env.PRODUCT }}-* --configuration=release" diff --git a/libs/sage-monorepo/nx-plugin/src/plugins/build-image-target.ts b/libs/sage-monorepo/nx-plugin/src/plugins/build-image-target.ts index 05f686c0a..d106f2ac1 100644 --- a/libs/sage-monorepo/nx-plugin/src/plugins/build-image-target.ts +++ b/libs/sage-monorepo/nx-plugin/src/plugins/build-image-target.ts @@ -34,7 +34,6 @@ export async function buildImageTarget( return { executor: '@nx-tools/nx-container:build', outputs: [], - options: { context, }, @@ -43,10 +42,17 @@ export async function buildImageTarget( local: { metadata: { images: [`ghcr.io/sage-bionetworks/${projectName}`], - tags: ['type=edge,branch=main', 'type=raw,value=local', 'type=sha'], + tags: ['type=raw,value=local', 'type=sha'], + }, + }, + edge: { + metadata: { + images: [`ghcr.io/sage-bionetworks/${projectName}`], + tags: ['type=edge,branch=main', 'type=sha'], }, + push: true, }, - ci: { + release: { metadata: { images: [`ghcr.io/sage-bionetworks/${projectName}`], tags: ['type=semver,pattern={{version}},value=${VERSION}', 'type=sha'],