mlpcardgame/.drone.yml

125 lines
2.5 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
- name: build
image: node
commands:
- yarn build
- 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
- 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
- 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
- name: test
image: node
commands:
- yarn test:unit
- name: coverage
image: node
commands:
- yarn test:unit --coverage
- 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
- 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
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./node_modules