Skip to content

Commit

Permalink
Merge pull request #22 from truefoundry/update-workflows-env-vars
Browse files Browse the repository at this point in the history
Update build-n-push workflow
  • Loading branch information
DeeAjayi authored Oct 10, 2024
2 parents f1f97b3 + 0ccb8e6 commit 1351b99
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ permissions:
contents: read

env:
JFROG_REGISTRY: tfy.jfrog.io
JFROG_PROJECT: tfy-images
REPOSITORY: ${{ matrix.repository }}
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 }}

jobs:
build:
Expand All @@ -39,15 +40,15 @@ jobs:
- name: Log in to JFrog Artifactory
uses: docker/login-action@v3
with:
username: ${{ secrets.JFROG_INTERNAL_USERNAME }}
password: ${{ secrets.JFROG_INTERNAL_PASSWORD }}
registry: tfy.jfrog.io
username: ${{ env.ARTIFACTORY_USERNAME }}
password: ${{ env.ARTIFACTORY_PASSWORD }}
registry: ${{ env.ARTIFACTORY_REGISTRY }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
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

0 comments on commit 1351b99

Please sign in to comment.