Last active
September 15, 2020 21:54
-
-
Save JayH5/d7ecc3f8bf3ed4be49b0454b5db2a15e to your computer and use it in GitHub Desktop.
Travis Docker caching config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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