From dcb66ee9890970844b22e4e1b9aea0bab663f2fc Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Sun, 15 Oct 2023 09:52:06 -0400 Subject: [PATCH 1/2] Reuse docker-build-push action to push multiple images --- .../workflows/docker-build-push-dockerhub.yml | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index a799a57..b23be25 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -163,19 +163,34 @@ jobs: env: NEXTAUTH_SECRET: 'EI4qqDpcfdvf4A+0aQEEx8JjHxHSy4uWiZw/F32K+pA=' CALENDSO_ENCRYPTION_KEY: '0zfLtY99wjeLnsM7qsa8xsT+Q0oSgnOL' - - - name: Push image - run: | - tags="${{ steps.meta.outputs.tags }}" - IFS=',' read -ra ADDR <<< "$tags" # Convert string to array using ',' as delimiter - for tag in "${ADDR[@]}"; do - docker push $tag - done - - + - name: Cleanup run: | docker compose down + # - name: Push image + # run: | + # tags="${{ steps.meta.outputs.tags }}" + # IFS=',' read -ra ADDR <<< "$tags" # Convert string to array using ',' as delimiter + # for tag in "${ADDR[@]}"; do + # docker push $tag + # done + + - name: Push image + id: docker_push + uses: docker/build-push-action@v4 + with: + context: ./ + file: ./Dockerfile + push: true # Do not push the image at this stage + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + NEXT_PUBLIC_WEBAPP_URL=${{ env.NEXT_PUBLIC_WEBAPP_URL }} + NEXT_PUBLIC_LICENSE_CONSENT=${{ env.NEXT_PUBLIC_LICENSE_CONSENT }} + NEXT_PUBLIC_TELEMETRY_KEY=${{ env.NEXT_PUBLIC_TELEMETRY_KEY }} + DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }} + - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} From e0521c140d4a32cd27fe9a7eeb75dd150f1e5029 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Sun, 15 Oct 2023 09:54:19 -0400 Subject: [PATCH 2/2] cleanup comments --- .github/workflows/docker-build-push-dockerhub.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index b23be25..19dccdf 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -118,10 +118,6 @@ jobs: NEXT_PUBLIC_LICENSE_CONSENT=${{ env.NEXT_PUBLIC_LICENSE_CONSENT }} NEXT_PUBLIC_TELEMETRY_KEY=${{ env.NEXT_PUBLIC_TELEMETRY_KEY }} DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }} - - # - name: Build with docker compose - # run: | - # DOCKER_BUILDKIT=0 docker compose build --build-arg DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }} calcom - name: Test runtime run: | @@ -182,7 +178,7 @@ jobs: with: context: ./ file: ./Dockerfile - push: true # Do not push the image at this stage + push: true platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}