Commit 898c7c3f authored by jonas's avatar jonas

Add gitlab ci template for docker publish

parent 0292945c
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: v2.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-yaml
- id: check-json
- id: pretty-format-json
- id: check-added-large-files
- id: check-symlinks
- repo: "https://github.com/prettier/prettier"
rev: HEAD
hooks:
- id: prettier
image: docker:18
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
services:
- docker:18-dind
deploy:
stage: deploy
before_script:
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
script:
- docker pull $CONTAINER_IMAGE:latest || true
- docker build
--cache-from $CI_REGISTRY_IMAGE:latest
--tag $CONTAINER_IMAGE:$CI_COMMIT_SHA
--tag $CONTAINER_IMAGE:latest
.
- docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
- docker push $CONTAINER_IMAGE:latest
only:
- master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment