stages: - test - build docker-build-master: needs: [ "test" ] image: docker:latest stage: build services: - docker:dind before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build --pull -t "$CI_REGISTRY_IMAGE" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" . - docker push "$CI_REGISTRY_IMAGE" - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" only: - main docker-build: needs: [ "test" ] image: docker:latest stage: build services: - docker:dind before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" . - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" except: - main test: image: python:3-alpine stage: test script: - pip install -r dev-requirements.txt - pytest -n $(nproc) --junitxml=report.xml --cov=importer artifacts: reports: junit: report.xml pages: needs: [ "test" ] image: name: pandoc/alpine entrypoint: - "" stage: build script: - mkdir public - pandoc --standalone README.md -o public/index.html artifacts: paths: - public only: - main