Make a script at .travis/docker_push:
Developers should feel free to update the functionality of this embed their custom workflow, tagging, branch structure, etc., this is just a simple baseline stolen from the early stages of asym-crypto-yaml.

#!/bin/bash

echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin

if [ ! -z "${TRAVIS_TAG}" ]; then
    docker tag edxops/MY_REPO:latest edxops/MY_REPO:${TRAVIS_TAG}
	docker push edxops/MY_REPO:${TRAVIS_TAG}
fi

docker push edxops/MY_REPO:latest



In the travis UI, set the travis environment variables for DOCKER_USERNAME and DOCKER_PASSWORD
You cannot encrypt these and put them in .travis.yml at the time of this writing, the travis 'script' provider fails and writes the encrypted password to the console.


Add the following provider to your .travis.yml

  - provider: script
    on:
      branch: master
      tags: true
    script: DOCKER_USERNAME=$DOCKER_USERNAME DOCKER_PASSWORD=$DOCKER_PASSWORD TRAVIS_TAG=$TRAVIS_TAG bash .travis/docker_push




If you need help configuring it for multiple providers look at the syntax here:
https://docs.travis-ci.com/user/deployment#deploying-to-multiple-providers