diff --git a/.github/workflows/build-n-push.yml b/.github/workflows/build-n-push.yml new file mode 100644 index 0000000..8030845 --- /dev/null +++ b/.github/workflows/build-n-push.yml @@ -0,0 +1,23 @@ +name: Build and Push Image to JFrog Artifactory + +on: + push: + branches: + - 'main' + +permissions: + id-token: write + contents: read + +jobs: + build: + name: Build, Scan and Release NUI Image + uses: truefoundry/workflows/.github/workflows/build.yml@v0.1.0 + with: + image_tag: ${{ github.sha }} + image_artifact_name: ${{ github.event.repository.name }} + 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 }} diff --git a/.github/workflows/public-ecr-image.yml b/.github/workflows/public-ecr-image.yml deleted file mode 100644 index 74c3bf8..0000000 --- a/.github/workflows/public-ecr-image.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Push image to to ECR - -on: - push: - branches: - - 'main' - -permissions: - id-token: write - contents: read - -jobs: - build: - name: Build Image - runs-on: ubuntu-latest - steps: - - name: Checkoutout code - uses: actions/checkout@v3 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.PUBLIC_ECR_IAM_ROLE_ARN }} - aws-region: us-east-1 - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - with: - registry-type: public - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push image - uses: docker/build-push-action@v5 - env: - REGISTRY: ${{ steps.login-ecr.outputs.registry }} - REGISTRY_ALIAS: truefoundrycloud - REPOSITORY: nui - IMAGE_TAG: ${{ github.sha }} - with: - context: . - push: true - tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}:buildcache - cache-to: mode=max,image-manifest=true,type=registry,ref=${{ env.REGISTRY }}/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}:buildcache \ No newline at end of file