Skip to content

Instantly share code, notes, and snippets.

@JayH5
Last active September 15, 2020 21:54
Show Gist options
  • Save JayH5/d7ecc3f8bf3ed4be49b0454b5db2a15e to your computer and use it in GitHub Desktop.
Save JayH5/d7ecc3f8bf3ed4be49b0454b5db2a15e to your computer and use it in GitHub Desktop.
Travis Docker caching config
sudo: required
services:
- docker
env:
global:
- REGISTRY_USER=myrobot
# REGISTRY_PASS=...
- secret: "<something long>"
before_script:
- docker pull myorg/myimage || true
script:
- docker build --pull --cache-from myorg/myimage --tag myorg/myimage .
- docker run myorg/myimage
after_script:
- docker images
before_deploy:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
deploy:
provider: script
script: docker push myorg/myimage
on:
branch: master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment