首页 > 解决方案 > Travis:将拉取请求合并到主服务器后进行部署

问题描述

假设我有release-1.0.0一个分支,我想为这个分支创建一个到 master 的拉取请求。创建拉取请求后,Travis 开始检查并运行构建脚本。

如果一切正常,github 会给我一个绿旗,并允许我将发布分支合并到 master。我将发布分支合并到 master 中,现在我想开始部署(到 npm 和 github 版本)。

我想使用 git tag 部署到 github 版本,但是当我将 pr 合并到 master 时,我丢失了我的标签,我得到了这样的结果:Skipping a deployment with the release provider because this is not a tagged commit。关于如何为我的 git 流做到这一点的任何想法?这是我的配置:

language: node_js
node_js:
 - lts/*
install:
- npm ci
- npm install -g codecov
script:
- npm run build 
- ./node_modules/.bin/nyc report --reporter lcovonly -- -R spec 
- codecov
branches:
  only: 
    - master
deploy:
  - provider: releases
    skip_cleanup: true
    api_key:
    secure: *****
    file: 'README.md'
    on:
      tags: true
      repo: name_of_repo
      branch: master
  - provider: npm
    email: email@email.com
    api_key:
      secure: *****
      on:
        tags: true
        repo: name_of_repo
        branch: master

标签: gitgithubnpmtravis-cidevops

解决方案


推荐阅读