Compare commits

...

2 Commits

Author SHA1 Message Date
ba01937703 ci: make use of pnpm store cache (#23)
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-10 17:22:28 +01:00
aae3e5c0fb ci: deploy to main site when branch is main 2023-06-10 17:08:48 +01:00
2 changed files with 18 additions and 3 deletions

View File

@ -6,11 +6,17 @@ name: default
steps:
- name: test & build
image: node:18.16.0-bullseye
volumes:
- name: pnpm-store-cache
path: /drone/.pnpm-store
commands:
# - git config --global --add safe.directory "/drone/src"
- npm install -g pnpm
- corepack enable # npm i -g pnpm
- pnpm i --frozen-lockfile
- pnpm build
environment:
npm_config_store_dir: /drone/.pnpm-store
npm_config_package_import_method: copy
- name: publish
image: node:18.16.0-bullseye
@ -28,3 +34,8 @@ steps:
- (cd dist && zip -r -9 ../um-react.zip .)
- ./scripts/publish.sh
- ./scripts/deploy.sh
volumes:
- name: pnpm-store-cache
host:
path: /tmp/.pnpm-store

View File

@ -3,15 +3,19 @@
BRANCH_NAME="$(git branch --show-current)"
__netlify_upload() {
local branch="$BRANCH_NAME"
local production="$DEPLOY_PRODUCTION"
[[ -z "$production" ]] && production="false"
[[ "$BRANCH_NAME" = "main" ]] && production="true"
if [[ "$BRANCH_NAME" = "main" ]]; then
production="true"
branch=""
fi
curl -sL \
-H "Content-Type: application/zip" \
-H "Authorization: Bearer ${NETLIFY_API_KEY}" \
--data-binary "@${1}" \
"https://api.netlify.com/api/v1/sites/${NETLIFY_SITE_ID}/deploys?branch=${BRANCH_NAME}&production=${production}"
"https://api.netlify.com/api/v1/sites/${NETLIFY_SITE_ID}/deploys?branch=${branch}&production=${production}"
}
__netlify_get_deploy() {