overleaf-sso/.gitlab-ci.yml

29 lines
1.1 KiB
YAML

# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Docker.gitlab-ci.yml
# Build a Docker image with CI/CD and push to the GitLab registry.
# Docker-in-Docker documentation: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
#
# This template uses one generic job with conditional builds
# for the default branch and all other (MR) branches.
docker-build:
# Use the official docker image.
cache: [] # disable cache to prevent old layers
image: docker:dind
variables:
stage: build
when: manual
services:
- docker:dind
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login glcr.cklau.cc --username "$CI_REGISTRY_USER" --password-stdin
# Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug)
script:
- |
docker build -t "glcr.cklau.cc/bayes-cluster/overleaf-sso" .
docker push "glcr.cklau.cc/bayes-cluster/overleaf-sso"