.drone.yml 968 B

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. kind: pipeline
  3. type: docker
  4. name: default
  5. steps:
  6. - name: test & build
  7. image: node:20.10.0-bookworm
  8. commands:
  9. # - git config --global --add safe.directory "/drone/src"
  10. - corepack enable
  11. - corepack prepare pnpm@latest --activate
  12. - pnpm i --frozen-lockfile
  13. - pnpm build
  14. environment:
  15. # 让 npm 使用淘宝源
  16. npm_config_registry: https://registry.npmmirror.com
  17. - name: publish
  18. image: node:20.10.0-bookworm
  19. environment:
  20. DRONE_GITEA_SERVER: https://git.unlock-music.dev
  21. GITEA_API_KEY:
  22. from_secret: GITEA_API_KEY
  23. NETLIFY_SITE_ID:
  24. from_secret: NETLIFY_SITE_ID
  25. NETLIFY_API_KEY:
  26. from_secret: NETLIFY_API_KEY
  27. commands:
  28. - |
  29. python3 -m zipfile -c um-react.zip dist/.
  30. cp um-react.zip dist/"release-${DRONE_COMMIT_SHA}.zip"
  31. python3 -m zipfile -c um-react-site.zip dist/.
  32. - ./scripts/publish.sh
  33. - ./scripts/deploy.sh