Only build once

This commit is contained in:
Hamcha 2022-05-10 16:38:16 +02:00
parent 5d1a248134
commit ab43ea0cdc
Signed by untrusted user: hamcha
GPG key ID: 1669C533B8CF6D89

View file

@ -28,7 +28,7 @@ steps:
depends_on: depends_on:
- dependencies - dependencies
- name: build_versioned - name: build
image: node image: node
commands: commands:
- npm run build - npm run build
@ -37,33 +37,9 @@ steps:
VITE_APP_REVISION: ${DRONE_COMMIT_SHA} VITE_APP_REVISION: ${DRONE_COMMIT_SHA}
when: when:
event: event:
- push include:
depends_on: - push
- dependencies - pull_request
- name: build_pr
image: node
commands:
- npm run build-pr
environment:
VITE_SUBPATH: /tghandbook/pr-${DRONE_PULL_REQUEST}
VITE_APP_REVISION: ${DRONE_COMMIT_SHA}
when:
event:
- pull_request
depends_on:
- dependencies
- name: build_branch
image: node
commands:
- npm run build-branch
environment:
VITE_SUBPATH: /tghandbook/${DRONE_COMMIT_BRANCH/\//_}
VITE_APP_REVISION: ${DRONE_COMMIT_SHA}
when:
event:
- push
depends_on: depends_on:
- dependencies - dependencies
@ -84,7 +60,7 @@ steps:
event: event:
- push - push
depends_on: depends_on:
- build_versioned - build
- name: upload_build_pr - name: upload_build_pr
image: plugins/s3 image: plugins/s3
@ -94,16 +70,16 @@ steps:
from_secret: minio_access from_secret: minio_access
secret_key: secret_key:
from_secret: minio_secret from_secret: minio_secret
source: dist-pr/**/* source: dist/**/*
target: /pr-${DRONE_PULL_REQUEST}/ target: /pr-${DRONE_PULL_REQUEST}/
strip_prefix: dist-pr/ strip_prefix: dist/
path_style: true path_style: true
endpoint: https://artifacts.fromouter.space endpoint: https://artifacts.fromouter.space
when: when:
event: event:
- pull_request - pull_request
depends_on: depends_on:
- build_pr - build
- name: upload_build_branch - name: upload_build_branch
image: plugins/s3 image: plugins/s3
@ -113,16 +89,16 @@ steps:
from_secret: minio_access from_secret: minio_access
secret_key: secret_key:
from_secret: minio_secret from_secret: minio_secret
source: dist-branch/**/* source: dist/**/*
target: /${DRONE_COMMIT_BRANCH/\//_}/ target: /${DRONE_COMMIT_BRANCH/\//_}/
strip_prefix: dist-branch/ strip_prefix: dist/
path_style: true path_style: true
endpoint: https://artifacts.fromouter.space endpoint: https://artifacts.fromouter.space
when: when:
event: event:
- push - push
depends_on: depends_on:
- build_branch - build
- name: rebuild-cache - name: rebuild-cache
image: drillster/drone-volume-cache image: drillster/drone-volume-cache
@ -149,5 +125,3 @@ trigger:
--- ---
kind: signature kind: signature
hmac: 80f0ae9213a4857606e7a6f2e64b9f1f47f1b80186f9ecd5b7aada7481a75db4 hmac: 80f0ae9213a4857606e7a6f2e64b9f1f47f1b80186f9ecd5b7aada7481a75db4
...