main: push: - docker: image: node:lts #volumes缓存:https://docs.cnb.cool/zh/grammar/pipeline.html#volumes volumes: # 使用缓存,同时更新 - /root/.npm:cow #导入环境变量:https://docs.cnb.cool/zh/env.html#dao-ru-huan-jing-bian-liang # imports: https://cnb.cool/xxx/xxxx/-/blob/main/react_cos_secret.yml stages: - name: Install dependencies script: | npm i -g hexo-cli npm i - name: Deploy hexo script: hexo clean && hexo generate # - name: run with tencentcom/coscli # image: tencentcom/coscli # 插件地址: https://docs.cnb.cool/zh/plugins/public/tencentcom/coscli # 配置coscli的COS_SECRET_ID、COS_SECRET_KEY、COS_BUCKET、COS_REGION # 执行coscli cp将本地的./public文件夹上传到$COS_BUCKET中 # script: | # coscli config set --secret_id $COS_SECRET_ID --secret_key $COS_SECRET_KEY # coscli config add --init-skip=true -b $COS_BUCKET -r $COS_REGION # coscli cp ./public cos://$BUCKET -r --exclude "./.git/*" $: vscode: # 在云原生开发环境中安装npm依赖 - services: - docker docker: build: dockerfile: .ide/Dockerfile stages: - name: Install dependencies script: | npm i -g hexo-cli npm i