diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89d4b7e..2aba41c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,16 +5,20 @@ build: script: - cargo-leptos build -# Build the docker image and push it to the registry -docker-build: - needs: ["build"] +.docker: image: docker:latest services: - docker:dind tags: - docker - script: + before_script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + +# Build the docker image and push it to the registry +docker-build: + needs: ["build"] + extends: .docker + script: - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA . # If running on the default branch, tag as latest - if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then docker tag