diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f2808fd1ba003..1dbc5f79bb6b0 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -148,6 +148,33 @@ jobs: java-version: 17 - name: Restore Gradle cache entries uses: gradle/gradle-build-action@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build and push the Docker image + uses: docker/build-push-action@v4 + with: + build-args: USER_ID=1001 + context: . + cache-from: type=registry,ref=ort:buildcache + cache-to: type=registry,ref=ort:buildcache,mode=max + push: true + tags: ort:pr + - name: Build and load the Docker image + uses: docker/build-push-action@v4 + with: + build-args: USER_ID=1001 + context: . + cache-from: type=registry,ref=ort:buildcache + cache-to: type=registry,ref=ort:buildcache,mode=max + load: true + - name: Build Docker image manually + run: DOCKER_BUILDKIT=1 docker build --build-arg USER_ID=1001 . - name: Validate Batect wrapper scripts uses: batect/batect-wrapper-validation-action@v0 - name: Run functional tests that do require external tools