--- ################ # SECRETS # ################ # push_deploy_key: id_rsa from DRONE host machine ################ # Build & Test # ################ kind: pipeline name: run_tests steps: # Test the vue theme - name: test image: node commands: - pwd - cd ./vue-theme - npm install - npm test volumes: # Link node_modules cache from host filesystem into container at the expected location - name: node_cache path: /drone/src/vue-theme/node_modules - name: build image: node commands: - cd ./vue-theme - rm -Rf ./build/* - npx browserslist@latest --update-db - npm run build - ls ./build environment: NODE_OPTIONS: --openssl-legacy-provider volumes: # Link node_modules cache from host filesystem into container at the expected location - name: node_cache path: /drone/src/vue-theme/node_modules - name: build path: /drone/src/vue-theme/build volumes: - name: node_cache host: path: /tmp/cache/drone/node_modules - name: build host: path: /tmp/cache/drone/build --- ######################## # Deploy to Production # ######################## kind: pipeline name: deploy depends_on: # Must run after the first pipeline - run_tests trigger: status: # Only runs if the first pipeline was fully successful - success steps: # post-receive hook - name: push commit image: appleboy/drone-git-push:0.2.0-linux-amd64 settings: branch: master remote: maeda@143.110.234.41:/opt/staging/vue-wp.git remote_name: staging force: true ssh_key: # !: id_rsa from DRONE machine from_secret: push_deploy_key volumes: - name: node_cache host: path: /tmp/cache/drone/node_modules - name: build host: path: /tmp/cache/drone/build