--- kind: pipeline type: docker name: default steps: - name: restore cache image: drillster/drone-volume-cache settings: restore: true mount: - ./node_modules volumes: - name: cache path: /cache - name: npm install image: node:12 commands: - npm install - name: npm run build image: node:12 commands: - npm run build - name: rebuild cache image: drillster/drone-volume-cache settings: rebuild: true mount: - ./node_modules volumes: - name: cache path: /cache #- name: npm run test # image: node:12 # commands: # - npm run test - name: build docs image: node:12 commands: - npm run docs when: event: - tag - name: deliver docs image: node:12 commands: - echo ${DRONE_BUILD_CREATED} - export GIT_SSL_NO_VERIFY=1 - git clone https://gitea.nitowa.xyz/docs/${DRONE_REPO_NAME}.git; cd ${DRONE_REPO_NAME} && rm -rf ./*; cp -r ../docs/* .; cp ../LICENSE.md . - sed -i '1,3d; $d' README.md && echo "### Version\n\n${DRONE_TAG}\n" >> ./README.md - sed -i -e 1,4d ./globals.md && cat ./globals.md >> ./README.md - git add --all; git -c user.email="${DRONE_COMMIT_AUTHOR_EMAIL}" -c user.name="${DRONE_COMMIT_AUTHOR}" commit --all --allow-empty --message "generated from tag ${DRONE_TAG}" - (git tag ${DRONE_TAG} && git push --force origin master ${DRONE_TAG}) || true environment: GIT_USER: from_secret: git_user GIT_PASSWORD: from_secret: git_password when: event: - tag - name: npm publish image: plugins/npm settings: username: nitowa password: from_secret: npm_password token: from_secret: npm_access_token email: peter.millauer@gmail.com when: event: - tag volumes: - name: cache host: path: /tmp