sudo: required branches: only: - /^v\d+\.\d+\.\d+(-\S+)?$/ # only build release tags services: - docker env: global: - GIT_NAME: "Richard Chien" - GIT_EMAIL: [email protected] - DOCKER_USER: richardchien - DOCKER_REPO: richardchien/cqhttp script: - export DOCKER_TAG=${TRAVIS_TAG#v} - docker build -t $DOCKER_REPO:$DOCKER_TAG --build-arg GIT_TAG=$TRAVIS_TAG ./docker after_success: - if [[ $DOCKER_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then docker tag $DOCKER_REPO:$DOCKER_TAG $DOCKER_REPO:latest; fi - docker login -u $DOCKER_USER -p $DOCKER_PASS - docker push $DOCKER_REPO