Skip to content

Instantly share code, notes, and snippets.

@JayH5
Created January 28, 2019 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JayH5/6ff358862ac73c717c3a4ca623f11e7a to your computer and use it in GitHub Desktop.
Save JayH5/6ff358862ac73c717c3a4ca623f11e7a to your computer and use it in GitHub Desktop.
Example release stage
dist: xenial
services:
- docker
language: bash
env:
global:
- IMAGE_TAG=praekeltorg/mysite
- REGISTRY_USER=praekeltorg-automation
- secret: <REGISTRY_PASS encrypted>
before_script:
- docker pull "$IMAGE_TAG" || true
script:
- docker build --pull --cache-from "$IMAGE_TAG" -t "$IMAGE_TAG" .
before_deploy:
- echo -n "$REGISTRY_PASS" | docker login -u "$REGISTRY_USER" --password-stdin
deploy:
provider: script
script: docker push "$IMAGE_TAG"
on:
branch: master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment