From cb12545a9deed18a2d996f39ac3db50fe26e83fb Mon Sep 17 00:00:00 2001 From: Ajayi Dipo Date: Tue, 22 Oct 2024 14:11:07 +0100 Subject: [PATCH] update build workflow to use reuseable workflow (#90) * update build workflow to use reuseable workflow --- .github/workflows/release-to-jfrog.yaml | 45 ++++++------------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/.github/workflows/release-to-jfrog.yaml b/.github/workflows/release-to-jfrog.yaml index 4e496c3..b7ee0db 100644 --- a/.github/workflows/release-to-jfrog.yaml +++ b/.github/workflows/release-to-jfrog.yaml @@ -1,8 +1,6 @@ name: Push image to JFrog Artifactory on: - # pull_request: - # types: [ opened, synchronize, reopened ] push: branches: - 'main' @@ -11,38 +9,15 @@ permissions: id-token: write contents: read -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 }}/async_processor - jobs: build: - name: Build Image - runs-on: ubuntu-latest - steps: - - name: Checkoutout code - uses: actions/checkout@v4 - - - name: Log in to JFrog Artifactory - uses: docker/login-action@v3 - with: - username: ${{ env.ARTIFACTORY_USERNAME }} - password: ${{ env.ARTIFACTORY_PASSWORD }} - registry: ${{ env.ARTIFACTORY_REGISTRY }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push image - uses: docker/build-push-action@v6 - with: - context: . - push: true - provenance: false - platforms: linux/amd64,linux/arm64 - 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 + name: Build + uses: truefoundry/workflows/.github/workflows/build.yml@main + with: + image_tag: ${{ github.sha }} + image_artifact_name: async_processor + artifactory_registry_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_REGISTRY_URL }} + artifactory_repository_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }} + secrets: + artifactory_username: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_USERNAME }} + artifactory_password: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_PASSWORD }}