Commit 8f518b3f authored by Matthew Pickering's avatar Matthew Pickering

Only push images for commits on the master branch

parent 2b69e99d
......@@ -10,14 +10,19 @@ variables:
.build:
stage: build
only:
- master
- merge_requests
script:
- |
CONTAINER_IMAGE="$CONTAINER_IMAGE_BASE/$IMAGE"
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.haskell.org
docker pull $CONTAINER_IMAGE:latest || true
docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest $IMAGE
docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
docker push $CONTAINER_IMAGE:latest
if [ -z "$CI_MERGE_REQUEST_ID" ]; then
docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
docker push $CONTAINER_IMAGE:latest
fi
build-linters:
extends: .build
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment