0

我有一个 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未启动。

知道如何解决吗?

4

0 回答 0