name: Testing Example on: push: branches: - master jobs: # Builds the image and pushes it to the registry # This image contains all the tooling necessary to run the compilation tools build-image: # Set up the docker daemon for building the image runs-on: ubuntu-latest steps: - name: build-image - run: docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY # Login to the registry - run: docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME || true # Pull the image if it exists # Build the image and tag it with the branch name and latest - run: docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME -t $CI_REGISTRY_IMAGE:latest . - run: docker push --all-tags $CI_REGISTRY_IMAGE # Push the image to the registry