mirror of
https://github.com/thumbsup/thumbsup
synced 2024-11-15 18:12:46 +00:00
3ec009e6c8
This means we can build and test local changes, not just the latest published version. Fixes #114 and merges #118.
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
# Build steps need access to the Docker agent
|
|
sudo: required
|
|
services:
|
|
- docker
|
|
|
|
jobs:
|
|
include:
|
|
|
|
# Run all the tests inside Docker
|
|
|
|
- stage: Test
|
|
script: docker build -f Dockerfile.test .
|
|
|
|
|
|
# If this is a tagged commit, publish the package to npm
|
|
|
|
- stage: Release npm
|
|
script: echo "Deploying to npm"
|
|
deploy:
|
|
provider: npm
|
|
email: asyncadventures@gmail.com
|
|
api_key: $NPM_TOKEN
|
|
on:
|
|
tags: true
|
|
condition: $TRAVIS_TAG =~ ^\d+\.\d+\.\d+$
|
|
|
|
# If this is a tagged commit, publish a new Docker image
|
|
|
|
- stage: Release Docker
|
|
script: echo "Deploying to DockerHub"
|
|
deploy:
|
|
provider: script
|
|
script:
|
|
- DOCKER_IMAGE="thumbsupgallery/thumbsup"
|
|
- docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
|
|
- docker build -f Dockerfile.release -t "${DOCKER_IMAGE}:${TRAVIS_TAG}" .
|
|
- docker tag "${DOCKER_IMAGE}:${TRAVIS_TAG}" "${DOCKER_IMAGE}:latest"
|
|
- docker push "${DOCKER_IMAGE}:${TRAVIS_TAG}"
|
|
- docker push "${DOCKER_IMAGE}:latest"
|
|
on:
|
|
tags: true
|
|
condition: $TRAVIS_TAG =~ ^\d+\.\d+\.\d+$
|