diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa58f50..79859b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,9 @@ build-binary: image: name: moby/buildkit:rootless entrypoint: [""] + rules: + - if: $CI_COMMIT_BRANCH == "main" + when: always stage: build variables: # Removes the need for privileged container access at the runner level @@ -30,8 +33,8 @@ build-binary: # buildctl-daemonless.sh acts as your ephemeral build orchestrator - buildctl-daemonless.sh build \ --frontend=dockerfile.v0 \ - --local context=build \ - --local dockerfile=Dockerfile \ + --local context="$CI_PROJECT_DIR/build" \ + --local dockerfile="$CI_PROJECT_DIR/build/Dockerfile" \ --opt platform=linux/amd64,linux/arm64 \ --export-cache type=registry,ref=$CACHE_IMAGE \ --import-cache type=registry,ref=$CACHE_IMAGE \