kind: pipeline 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: rebuild documentation image: node:12 commands: - rm -rf docs - npm run docs when: event: - tag - name: npm publish image: plugins/npm settings: username: frontwork password: from_secret: npm_password email: frontwork.me@gmail.com when: event: - tag - name: deploy documentation image: node:12 commands: - echo ${DRONE_BUILD_CREATED} - git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}" - git config --global user.name "${DRONE_COMMIT_AUTHOR}" - echo "clone ${DRONE_REPO_NAME}"; git clone https://gitea.frontblock.me/fw-docs/${DRONE_REPO_NAME}.git - echo "remove files in ${DRONE_REPO_NAME}"; rm -rf ./${DRONE_REPO_NAME}/* - echo "copy docs to ${DRONE_REPO_NAME}"; cp -r ./docs/* ./${DRONE_REPO_NAME} - ls ./${DRONE_REPO_NAME} - echo "add files in ${DRONE_REPO_NAME}"; git add ${DRONE_REPO_NAME}/* - git commit -m "Drone tagged as ${DRONE_TAG}" - git tag "${DRONE_TAG}" - git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-docs/${DRONE_REPO_NAME}.git master ${DRONE_TAG} environment: GIT_USER: from_secret: git_user GIT_PASSWORD: from_secret: git_password when: event: - tag volumes: - name: cache host: path: /tmp