2023-06-09 00:01:41 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: test & build
|
|
|
|
image: node:18.16.0-bullseye
|
|
|
|
commands:
|
|
|
|
# - git config --global --add safe.directory "/drone/src"
|
2023-06-10 16:31:12 +00:00
|
|
|
- npm install -g pnpm
|
2023-06-10 16:02:36 +00:00
|
|
|
- pnpm i --frozen-lockfile
|
|
|
|
- pnpm build
|
2023-06-10 17:00:31 +00:00
|
|
|
environment:
|
2023-06-10 17:05:50 +00:00
|
|
|
# 让 npm 使用淘宝源
|
2023-06-10 17:00:31 +00:00
|
|
|
npm_config_registry: https://registry.npmmirror.com
|
2023-06-09 00:01:41 +00:00
|
|
|
|
|
|
|
- name: publish
|
|
|
|
image: node:18.16.0-bullseye
|
|
|
|
environment:
|
|
|
|
DRONE_GITEA_SERVER: https://git.unlock-music.dev
|
|
|
|
GITEA_API_KEY:
|
|
|
|
from_secret: GITEA_API_KEY
|
|
|
|
NETLIFY_SITE_ID:
|
|
|
|
from_secret: NETLIFY_SITE_ID
|
|
|
|
NETLIFY_API_KEY:
|
|
|
|
from_secret: NETLIFY_API_KEY
|
|
|
|
commands:
|
|
|
|
# - git config --global --add safe.directory "/drone/src"
|
2023-06-10 17:24:39 +00:00
|
|
|
# 让 Debian 使用中科大源;测试网易和阿里的源速度不理想。
|
|
|
|
- sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
|
2023-06-09 00:01:41 +00:00
|
|
|
- apt-get update && apt-get install -y zip jq tar gzip curl
|
|
|
|
- (cd dist && zip -r -9 ../um-react.zip .)
|
|
|
|
- ./scripts/publish.sh
|
|
|
|
- ./scripts/deploy.sh
|