mlpcardgame/.drone.yml
Hamcha a6ecace783
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Update build to allow custom path (or use relative paths)
2019-09-10 12:19:37 +02:00

176 lines
3.4 KiB
YAML

kind: pipeline
name: default
steps:
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./node_modules
- name: dependencies
image: node
commands:
- yarn
depends_on:
- restore-cache
- name: build_versioned
image: node
commands:
- yarn build
environment:
SUBPATH: /${DRONE_COMMIT_SHA:0:8}
when:
event:
- push
depends_on:
- dependencies
- name: build_pr
image: node
commands:
- yarn build
environment:
SUBPATH: /pr-${DRONE_PULL_REQUEST}
when:
event:
- pull_request
depends_on:
- dependencies
- name: build_master
image: node
commands:
- yarn build
environment:
SUBPATH: /latest
when:
event:
- push
branch:
- master
depends_on:
- dependencies
- name: upload_build_versioned
image: plugins/s3
settings:
bucket: mcg
access_key:
from_secret: minio_access
secret_key:
from_secret: minio_secret
source: dist/**/*
target: /${DRONE_COMMIT_SHA:0:8}/
path_style: true
endpoint: https://artifacts.fromouter.space
when:
event:
- push
depends_on:
- build_versioned
- name: upload_build_pr
image: plugins/s3
settings:
bucket: mcg
access_key:
from_secret: minio_access
secret_key:
from_secret: minio_secret
source: dist/**/*
target: /pr-${DRONE_PULL_REQUEST}/
path_style: true
endpoint: https://artifacts.fromouter.space
when:
event:
- pull_request
depends_on:
- build_pr
- name: upload_build_master
image: plugins/s3
settings:
bucket: mcg
access_key:
from_secret: minio_access
secret_key:
from_secret: minio_secret
source: dist/**/*
target: /latest/
path_style: true
endpoint: https://artifacts.fromouter.space
when:
event:
- push
branch:
- master
depends_on:
- build_master
- name: test
image: node
commands:
- yarn test:unit
depends_on:
- dependencies
- name: coverage
image: node
commands:
- yarn test:unit --coverage
depends_on:
- dependencies
- name: upload_coverage
image: plugins/s3
settings:
bucket: mcg
access_key:
from_secret: minio_access
secret_key:
from_secret: minio_secret
source: coverage/lcov-report/**/*
target: /${DRONE_COMMIT_SHA:0:8}/
path_style: true
endpoint: https://artifacts.fromouter.space
when:
event:
- push
depends_on:
- coverage
- name: upload_coverage_pr
image: plugins/s3
settings:
bucket: mcg
access_key:
from_secret: minio_access
secret_key:
from_secret: minio_secret
source: coverage/lcov-report/**/*
target: /pr-${DRONE_PULL_REQUEST}/
path_style: true
endpoint: https://artifacts.fromouter.space
when:
event:
- pull_request
depends_on:
- coverage
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./node_modules
depends_on:
- dependencies