87 lines
2.1 KiB
YAML
87 lines
2.1 KiB
YAML
pipeline:
|
|
dependencies:
|
|
image: node
|
|
commands:
|
|
- yarn
|
|
|
|
build_versioned:
|
|
image: node
|
|
commands:
|
|
- export SUBPATH=/tghandbook/${DRONE_COMMIT_BRANCH/\//_}-${DRONE_COMMIT_SHA:0:8}
|
|
- export REVISION=${DRONE_COMMIT_SHA}
|
|
- yarn build
|
|
group: build
|
|
|
|
build_pr:
|
|
image: node
|
|
commands:
|
|
- export SUBPATH=/tghandbook/pr-$${DRONE_PULL_REQUEST}
|
|
- export REVISION=${DRONE_COMMIT_SHA}
|
|
- yarn build
|
|
environment:
|
|
- OUTDIR=./dist-pr
|
|
when:
|
|
event: pull_request
|
|
group: build
|
|
|
|
build_branch:
|
|
image: node
|
|
commands:
|
|
- export SUBPATH=/tghandbook/${DRONE_COMMIT_BRANCH/\//_}
|
|
- export REVISION=${DRONE_COMMIT_SHA}
|
|
- yarn build
|
|
environment:
|
|
- OUTDIR=./dist-branch
|
|
when:
|
|
event: push
|
|
group: build
|
|
|
|
upload_build_versioned:
|
|
image: woodpeckerci/plugin-s3
|
|
secrets: [minio_access, minio_secret]
|
|
settings:
|
|
bucket: tghandbook
|
|
source: ./dist/**/*
|
|
target: /${DRONE_COMMIT_BRANCH/\//_}-${DRONE_COMMIT_SHA:0:8}/
|
|
strip_prefix: dist/
|
|
path_style: true
|
|
endpoint: https://artifacts.fromouter.space
|
|
environment:
|
|
AWS_ACCESS_KEY_ID: $MINIO_ACCESS
|
|
AWS_SECRET_ACCESS_KEY: $MINIO_SECRET
|
|
when:
|
|
event: push
|
|
group: upload
|
|
|
|
upload_build_pr:
|
|
image: woodpeckerci/plugin-s3
|
|
secrets: [minio_access, minio_secret]
|
|
settings:
|
|
bucket: tghandbook
|
|
source: ./dist-pr/**/*
|
|
target: /pr-${DRONE_PULL_REQUEST}/
|
|
strip_prefix: dist-pr/
|
|
path_style: true
|
|
endpoint: https://artifacts.fromouter.space
|
|
environment:
|
|
AWS_ACCESS_KEY_ID: $MINIO_ACCESS
|
|
AWS_SECRET_ACCESS_KEY: $MINIO_SECRET
|
|
when:
|
|
event: pull_request
|
|
group: upload
|
|
|
|
upload_build_branch:
|
|
image: woodpeckerci/plugin-s3
|
|
secrets: [minio_access, minio_secret]
|
|
settings:
|
|
bucket: tghandbook
|
|
source: ./dist-branch/**/*
|
|
target: /${DRONE_COMMIT_BRANCH/\//_}/
|
|
strip_prefix: dist-branch/
|
|
path_style: true
|
|
endpoint: https://artifacts.fromouter.space
|
|
environment:
|
|
AWS_ACCESS_KEY_ID: $MINIO_ACCESS
|
|
AWS_SECRET_ACCESS_KEY: $MINIO_SECRET
|
|
group: upload
|