image: node:13.5-buster stages: - orthography - build - package - test #- deploy spellcheck: stage: orthography image: node:10 before_script: - npm i -g markdown-spellcheck script: - mdspell -r -n -a --en-gb "content/posts/*.md" "content/posts/*.markdown" tags: - docker build: image: docker.io/cibuilds/hugo stage: build variables: HUGO_ENV: production LANG: C.UTF-8 before_script: - hugo --minify --enableGitInfo script: - htmlproofer ./public --allow-hash-href --check-html --empty-alt-ignore --disable-external artifacts: untracked: true paths: - public expire_in: 1 week package-deploy: stage: package services: - docker:dind variables: DOCKER_HOST: "tcp://docker:2375" LANG: C.UTF-8 before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build --pull -f _docker/Dockerfile -t "$CI_REGISTRY_IMAGE" . - docker push "$CI_REGISTRY_IMAGE" only: - deploy tags: - docker package: stage: package services: - docker:dind variables: DOCKER_HOST: "tcp://docker:2375" LANG: C.UTF-8 before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build --pull -f _docker/Dockerfile -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" except: - deploy tags: - docker test: stage: test services: - docker:dind variables: DOCKER_HOST: "tcp://docker:2375" LANG: C.UTF-8 before_script: - apt-get install curl script: - docker run -d -p 80:80 --name testing $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG - sleep 5 - docker exec testing nginx -c /etc/nginx/nginx.conf -t - curl http://docker/status.txt | grep -q 'OK' - docker stop testing - docker rm testing except: - deploy tags: - docker test-deploy: stage: test services: - docker:dind variables: DOCKER_HOST: "tcp://docker:2375" LANG: C.UTF-8 before_script: - apt-get install curl script: - docker run -d -p 80:80 --name testing $CI_REGISTRY_IMAGE - sleep 5 - curl http://docker/status.txt | grep -q 'OK' - docker stop testing - docker rm testing only: - deploy tags: - docker