This repository has been archived on 2022-05-10. You can view files and clone it, but cannot push or open issues or pull requests.
tghandbook/.drone.yml

154 lines
3.1 KiB
YAML
Raw Normal View History

2020-06-17 13:48:05 +00:00
---
2020-06-17 13:16:54 +00:00
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
failure: ignore
commands:
- yarn
depends_on:
- restore-cache
- name: lint
image: node
commands:
- yarn lint
depends_on:
- dependencies
- name: build_versioned
image: node
commands:
- yarn build
2020-06-17 13:48:05 +00:00
environment:
2022-05-10 10:27:27 +00:00
VITE_SUBPATH: /tghandbook/${DRONE_COMMIT_BRANCH/\//_}-${DRONE_COMMIT_SHA:0:8}
VITE_APP_REVISION: ${DRONE_COMMIT_SHA}
2020-06-17 13:16:54 +00:00
when:
event:
- push
depends_on:
- dependencies
- name: build_pr
image: node
commands:
- yarn build
2020-06-17 13:48:05 +00:00
environment:
2022-05-10 10:27:27 +00:00
VITE_SUBPATH: /tghandbook/pr-${DRONE_PULL_REQUEST}
2020-06-18 12:13:32 +00:00
OUTDIR: ./dist-pr
2022-05-10 10:27:27 +00:00
VITE_APP_REVISION: ${DRONE_COMMIT_SHA}
2020-06-17 13:16:54 +00:00
when:
event:
- pull_request
depends_on:
- dependencies
2020-06-19 18:43:58 +00:00
- name: build_branch
2020-06-17 13:16:54 +00:00
image: node
commands:
- yarn build
environment:
2022-05-10 10:27:27 +00:00
VITE_SUBPATH: /tghandbook/${DRONE_COMMIT_BRANCH/\//_}
2020-06-19 18:43:58 +00:00
OUTDIR: ./dist-branch
2022-05-10 10:27:27 +00:00
VITE_APP_REVISION: ${DRONE_COMMIT_SHA}
2020-06-17 13:16:54 +00:00
when:
event:
- push
depends_on:
- dependencies
- name: upload_build_versioned
image: plugins/s3
settings:
bucket: tghandbook
access_key:
from_secret: minio_access
secret_key:
from_secret: minio_secret
source: dist/**/*
2020-06-18 12:20:29 +00:00
target: /${DRONE_COMMIT_BRANCH/\//_}-${DRONE_COMMIT_SHA:0:8}/
strip_prefix: dist/
2020-06-17 13:16:54 +00:00
path_style: true
endpoint: https://artifacts.fromouter.space
when:
event:
- push
depends_on:
- build_versioned
- name: upload_build_pr
image: plugins/s3
settings:
bucket: tghandbook
access_key:
from_secret: minio_access
secret_key:
from_secret: minio_secret
2020-06-18 12:13:32 +00:00
source: dist-pr/**/*
2020-06-17 13:16:54 +00:00
target: /pr-${DRONE_PULL_REQUEST}/
2020-06-18 12:20:29 +00:00
strip_prefix: dist-pr/
2020-06-17 13:16:54 +00:00
path_style: true
endpoint: https://artifacts.fromouter.space
when:
event:
- pull_request
depends_on:
- build_pr
2020-06-19 18:43:58 +00:00
- name: upload_build_branch
2020-06-17 13:16:54 +00:00
image: plugins/s3
settings:
bucket: tghandbook
access_key:
from_secret: minio_access
secret_key:
from_secret: minio_secret
2020-06-19 18:43:58 +00:00
source: dist-branch/**/*
target: /${DRONE_COMMIT_BRANCH/\//_}/
strip_prefix: dist-branch/
2020-06-17 13:16:54 +00:00
path_style: true
endpoint: https://artifacts.fromouter.space
when:
event:
- push
depends_on:
2020-06-19 18:43:58 +00:00
- build_branch
2020-06-17 13:16:54 +00:00
- name: rebuild-cache
image: drillster/drone-volume-cache
failure: ignore
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./node_modules
depends_on:
- dependencies
volumes:
- name: cache
host:
path: /opt/gitea/drone-cache/hamcha/tghandbook
2022-05-10 10:41:36 +00:00
trigger:
event:
- push
- pull_request
2020-06-17 13:48:05 +00:00
---
kind: signature
2022-05-10 10:41:36 +00:00
hmac: c7b6e232691aff687451a9f85599852d4af0e3b63198c41116be4e09e7d82e93