You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.3 KiB

  1. box: node:8-alpine
  2. build:
  3. steps:
  4. - script:
  5. name: install dependencies
  6. code: |
  7. apk update
  8. apk add bash build-base curl git openssh yarn
  9. - script:
  10. name: yarn install
  11. code: |
  12. yarn config set cache-folder "$WERCKER_CACHE_DIR/yarn"
  13. yarn install
  14. - script:
  15. name: build
  16. code: yarn run build
  17. - npm-test
  18. deploy-github:
  19. steps:
  20. - script:
  21. name: package
  22. code: |
  23. tar -czfv wiki-js.tar.gz * -X .build/.deployexclude
  24. yarn install --production --ignore-scripts --prefer-offline
  25. tar -czfv node_modules.tar.gz node_modules
  26. SEMVER_LAST=`npm show wiki.js version`
  27. chmod +x ./.build/semver_next.sh
  28. SEMVER_NEXT=`./.build/semver_next.sh -p $SEMVER_LAST`
  29. - github-create-release:
  30. token: $GITHUB_TOKEN
  31. tag: "v${SEMVER_NEXT}"
  32. prerelease: true
  33. - github-upload-asset:
  34. token: $GITHUB_TOKEN
  35. file: wiki-js.tar.gz
  36. - github-upload-asset:
  37. token: $GITHUB_TOKEN
  38. file: node_modules.tar.gz
  39. deploy-docker:
  40. steps:
  41. - internal/docker-push:
  42. username: $DOCKER_HUB_USERNAME
  43. password: $DOCKER_HUB_PASSWORD
  44. tag: latest
  45. ports: "3000"
  46. entrypoint: node server
  47. repository: requarks/wiki
  48. registry: https://registry.hub.docker.com