hugo-site/.gitlab-ci.yml
2018-04-09 18:31:42 +02:00

46 lines
950 B
YAML

image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest
services:
- docker:dind
stages:
- test
- deploy
before_script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
test:
stage: test
script:
- docker build -t $IMAGE_NAME .
- docker run -v `pwd`:/git $IMAGE_NAME /bin/sh -c "wget -qO- https://fedoraproject.org/static/hotspot.txt | grep OK && cd /git && hugo"
except:
- schedules
deploy:
stage: deploy
script:
- docker build -t $IMAGE_NAME -t $IMAGE_LATEST .
- docker push $IMAGE_NAME
- docker push $IMAGE_LATEST
only:
- tags
update:
image: python:3.6
before_script: []
script:
- pip install requests
- ./update.py $API_TOKEN $CI_PROJECT_PATH
only:
- schedules