From 40a257828c313ed2c5fcee1b264d3b7eddfd0623 Mon Sep 17 00:00:00 2001 From: chavda-bhavik Date: Mon, 8 Jul 2024 12:21:04 +0530 Subject: [PATCH 1/2] feat: streamlined app image builds with tags --- .github/workflows/build-api.yml | 6 +++--- .github/workflows/build-embed.yml | 4 ++-- .github/workflows/build-queuemanager.yml | 4 ++-- .github/workflows/build-web.yml | 5 +++-- .github/workflows/build-widget.yml | 5 +++-- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-api.yml b/.github/workflows/build-api.yml index e3d12e23b..6d5082166 100644 --- a/.github/workflows/build-api.yml +++ b/.github/workflows/build-api.yml @@ -56,13 +56,13 @@ jobs: run: | echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/api/Dockerfile . - docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest # docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod + docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest docker run --network=host --name api -dit --env NODE_ENV=test --env JWT_SECRET=impler --env COOKIE_DOMAIN=impler ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:3000/v1/health-check | grep 'ok' # docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest - # docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG - # echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG" + docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG + echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG" diff --git a/.github/workflows/build-embed.yml b/.github/workflows/build-embed.yml index 130630b46..92d657547 100644 --- a/.github/workflows/build-embed.yml +++ b/.github/workflows/build-embed.yml @@ -54,10 +54,10 @@ jobs: run: | echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f libs/embed/Dockerfile . + # docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest - docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod - docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod + # docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG" diff --git a/.github/workflows/build-queuemanager.yml b/.github/workflows/build-queuemanager.yml index 4b28e17a8..8b1e46c0b 100644 --- a/.github/workflows/build-queuemanager.yml +++ b/.github/workflows/build-queuemanager.yml @@ -51,10 +51,10 @@ jobs: run: | echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/queue-manager/Dockerfile . + # docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest - docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod - docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod + # docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG" diff --git a/.github/workflows/build-web.yml b/.github/workflows/build-web.yml index 6d90fba81..ecd826c68 100644 --- a/.github/workflows/build-web.yml +++ b/.github/workflows/build-web.yml @@ -51,9 +51,10 @@ jobs: run: | echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/web/Dockerfile . - docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod + # docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest - docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod + + # docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG" diff --git a/.github/workflows/build-widget.yml b/.github/workflows/build-widget.yml index 87d879018..4208b4074 100644 --- a/.github/workflows/build-widget.yml +++ b/.github/workflows/build-widget.yml @@ -55,9 +55,10 @@ jobs: run: | echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/widget/Dockerfile . - docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod + # docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest - docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod + + # docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG" From 5268a8b97ded9c86457fd0f7e13a4492a01e716b Mon Sep 17 00:00:00 2001 From: chavda-bhavik Date: Mon, 8 Jul 2024 12:21:24 +0530 Subject: [PATCH 2/2] fix: Package release issues --- .github/workflows/publish-prod-packages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-prod-packages.yml b/.github/workflows/publish-prod-packages.yml index 74572f801..ff1d66a28 100644 --- a/.github/workflows/publish-prod-packages.yml +++ b/.github/workflows/publish-prod-packages.yml @@ -46,7 +46,7 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} working-directory: libs/shared run: | - npm config set registry https://registry.npmjs.org/ + npm config set --workspaces=false --include-workspace-root registry https://registry.npmjs.org/ npm config set --workspaces=false --include-workspace-root //registry.npmjs.org/:_authToken=$NPM_TOKEN npm publish --access public @@ -55,6 +55,6 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} working-directory: packages/react run: | - npm config set registry https://registry.npmjs.org/ + npm config set --workspaces=false --include-workspace-root registry https://registry.npmjs.org/ npm config set --workspaces=false --include-workspace-root //registry.npmjs.org/:_authToken=$NPM_TOKEN npm publish --access public