如何创建启动另一个 GitHub 操作工作流的 GitHub 操作工作流?

问题描述

我有一个 Angular 应用程序,源代码存储在 GitHub 上。我想创建这个管道来部署代码:

  1. 将任何内容推送到 deploy-test 分支时,它会启动工作流程。
  2. GitHub 将创建一个跑步者
  3. Runner 拉取代码
  4. Runner 开始构建过程
  5. Runner 创建一个新的 git 分支,名为 deploy-test-build
  6. Runner 将构建的文件推送到 GitHub 存储库。
  7. 自托管运行器观察 deploy-test-build 分支上的推送,它启动另一个工作流。

这是我的第一个操作文件:

name: Build test

on:
  push:
    branches:
      - deploy-test

jobs:
  build:
    name: Build and Test
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        ref: deploy-test
    - name: Use Node 12.x
      uses: actions/setup-node@v1
      with:
        node-version: '12.x'
    - name: Install dependencies
      run: |
        cd angular
        npm ci
    - name: Build
      run: cd angular && npm run build:ci:test
    - name: Publish build
      run: |
        git config --global user.email "my email"
        git config --global user.name my name"
        git checkout -b deploy-test-build
        git add --force angular/dist
        git commit -m "latest build"
        git push --force origin deploy-test-build

最后一步有这个输出:

Run git config --global user.email "my email"
Switched to a new branch 'deploy-test-build'
[deploy-test-build d3fce92] latest build
 9 files changed,1485 insertions(+)
 create mode 100644 dist/3rdpartylicenses.txt
 create mode 100644 dist/favicon.ico
 create mode 100644 dist/index.html
 create mode 100644 dist/main.0ac5b66d2bf9e9e9e7ab.js
 create mode 100644 dist/polyfills-es5.71ee1b4bd0370b429e7d.js
 create mode 100644 dist/polyfills.22c48ffe45b9a56d0593.js
 create mode 100644 dist/runtime.eba877d1204fd67b69cb.js
 create mode 100644 dist/scripts.7a55fdf6a96cbe55ae9f.js
 create mode 100644 dist/styles.18a91683a46b36a985e8.js
To https://github.com/myrepos-name
 + 4298d17...d3fce92 deploy-test-build -> deploy-test-build (forced update)

下一个:

name: Deploy to test server

on:
  push:
    branches:
      - deploy-test-build

jobs:
  prepare:
    name: Prepare to clone a new version
    runs-on: self-hosted
    steps:
      # ...

但最后一个名为 Deploy to test server 的工作流没有启动。

知道如何修复它吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...