【问题标题】:How can I run multiple Node App in a Github Actions?如何在 Github Actions 中运行多个 Node 应用程序?
【发布时间】:2021-07-17 20:36:12
【问题描述】:

这是我的行为

# This is a basic workflow to help you get started with Actions

name: CI/CD Akper Bina Insan - Live

on:
  push:
    branches: [ master ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [14.x]
    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
    - name: Install Yarn
      run: npm install -g yarn
    - name: Build UI - Akper Bina Insan
      working-directory: ./ui
      run: yarn && yarn build && yarn start
    - name: Build Backend Service - Akper Bina Insan
      working-directory: ./be
      run: yarn && yarn build && yarn prod

第一次运行完成后,它不会继续第二次运行。即使服务器已准备就绪。我等了 5 分钟,然后因为不想浪费时间而停下来。

如何让它运行第二个?

【问题讨论】:

    标签: node.js reactjs github-actions


    【解决方案1】:

    GitHub 操作是用于 CI/CD 的工具,不是用于托管(运行)您的应用程序的工具。

    在给定的工作流程中,您 buildrun 您的 UI 应用程序。运行命令是一个阻塞进程 - 例如由于您已启动 UI 应用程序,您的工作流程将保持阻塞状态。您不应该在工作流程中这样做。

    使用 GitHub Action 进行构建和测试,但不用于托管。

    【讨论】:

    • 嗨,丹尼斯,感谢您的回复。自托管跑步者怎么样?我看到几个 youtuber 这样做是为了将更改推送到 vps
    猜你喜欢
    • 2019-11-05
    • 2021-03-12
    • 2019-10-19
    • 1970-01-01
    • 1970-01-01
    • 2023-02-21
    • 2020-04-02
    • 2021-01-08
    • 2020-05-13
    相关资源
    最近更新 更多