From 516478d993ccd7d000194eee993c95780f9c6781 Mon Sep 17 00:00:00 2001 From: Dipo Ajayi Date: Tue, 8 Oct 2024 09:49:22 +0100 Subject: [PATCH 1/3] Update build-n-push workflow --- .github/workflows/build-and-push.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml index a73e119..5437c98 100644 --- a/.github/workflows/build-and-push.yaml +++ b/.github/workflows/build-and-push.yaml @@ -13,10 +13,10 @@ permissions: contents: read env: - JFROG_REGISTRY: tfy.jfrog.io - JFROG_PROJECT: tfy-images - REPOSITORY: ${{ matrix.repository }} IMAGE_TAG: ${{ github.sha }} + ARTIFACTORY_USERNAME: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_PASSWORD }} + ARTIFACTORY_REPOSITORY_URL: ${{ env.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }}/${{ matrix.repository }} jobs: build: @@ -39,8 +39,8 @@ jobs: - name: Log in to JFrog Artifactory uses: docker/login-action@v3 with: - username: ${{ secrets.JFROG_INTERNAL_USERNAME }} - password: ${{ secrets.JFROG_INTERNAL_PASSWORD }} + username: ${{ env.ARTIFACTORY_USERNAME }} + password: ${{ env.ARTIFACTORY_PASSWORD }} registry: tfy.jfrog.io - name: Build and push Docker image @@ -48,6 +48,6 @@ jobs: with: file: ${{ matrix.directory }}/Dockerfile push: true - tags: ${{ env.JFROG_REGISTRY }}/${{ env.JFROG_PROJECT }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }} - cache-from: type=registry,ref=${{ env.JFROG_REGISTRY }}/${{ env.JFROG_PROJECT }}/${{ env.REPOSITORY }}:buildcache - cache-to: mode=max,image-manifest=true,type=registry,ref=${{ env.JFROG_REGISTRY }}/${{ env.JFROG_PROJECT }}/${{ env.REPOSITORY }}:buildcache + tags: ${{ env.ARTIFACTORY_REPOSITORY_URL }}:${{ env.IMAGE_TAG }} + cache-from: type=registry,ref=${{ env.ARTIFACTORY_REPOSITORY_URL }}:buildcache + cache-to: mode=max,image-manifest=true,type=registry,ref=${{ env.ARTIFACTORY_REPOSITORY_URL }}:buildcache From dc49129b562f2dd55cd919d4d5848fe149c3d55d Mon Sep 17 00:00:00 2001 From: Ajayi Dipo Date: Thu, 10 Oct 2024 13:24:09 +0100 Subject: [PATCH 2/3] Update build-and-push.yaml --- .github/workflows/build-and-push.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml index 5437c98..617a17a 100644 --- a/.github/workflows/build-and-push.yaml +++ b/.github/workflows/build-and-push.yaml @@ -16,7 +16,7 @@ env: IMAGE_TAG: ${{ github.sha }} ARTIFACTORY_USERNAME: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_PASSWORD }} - ARTIFACTORY_REPOSITORY_URL: ${{ env.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }}/${{ matrix.repository }} + ARTIFACTORY_REPOSITORY_URL: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }}/${{ matrix.repository }} jobs: build: From 0ccb8e64400c012bcad085f2bb62fd022e2ba270 Mon Sep 17 00:00:00 2001 From: Ajayi Dipo Date: Thu, 10 Oct 2024 13:28:03 +0100 Subject: [PATCH 3/3] Update build-and-push.yaml --- .github/workflows/build-and-push.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml index 617a17a..94c4824 100644 --- a/.github/workflows/build-and-push.yaml +++ b/.github/workflows/build-and-push.yaml @@ -14,6 +14,7 @@ permissions: env: IMAGE_TAG: ${{ github.sha }} + ARTIFACTORY_REGISTRY: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_REGISTRY_URL }} ARTIFACTORY_USERNAME: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_PASSWORD }} ARTIFACTORY_REPOSITORY_URL: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }}/${{ matrix.repository }} @@ -41,7 +42,7 @@ jobs: with: username: ${{ env.ARTIFACTORY_USERNAME }} password: ${{ env.ARTIFACTORY_PASSWORD }} - registry: tfy.jfrog.io + registry: ${{ env.ARTIFACTORY_REGISTRY }} - name: Build and push Docker image uses: docker/build-push-action@v6