我从未在github操作中编写管道,我被要求为一个请求创建管道,我做了一些事情:
# This is a basic workflow to help you get started with Actions
name: pipeline_action_on_pull_request
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
pull_request:
branches:
- dev
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
lint_and_test:
# The type of runner that the job will run on
runs-on: linux
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- run: npm install
- run: npm lint
- run: npm test
但是,在拉动需求之后,它的输出:
No runner matching the specified labels was found: linux
发布于 2021-11-09 12:43:21
我准备了一个esquema部署到生产,您需要使用,npm安装,清洁.cache,构建开发,等等如下:
jobs:
build:
if: contains(github.ref, 'development') || contains(github.ref, 'production')
name: Build
runs-on: ubuntu-latest
steps:
- name: node version
run: node -v
- run: echo ${{ github.ref }}
- name: Checkout Repo
uses: actions/checkout@v2
- name: Install dependencies
run: npm install
- name: Build Development
if: contains(github.ref, 'development')
run: npm run build
GitHub-托管的运行程序--如果使用GitHub托管的运行程序,则每个作业都在运行时指定的虚拟环境的新实例中运行。
可用的GitHub托管运行程序类型如下:
虚拟环境YAML工作流标签注释Windows Server 2022 uses -2022 Windows -最新标签当前使用Windows 2019运行程序映像。Windows Server 2019 Windows -最新窗口或windows-2019 Windows Server 2016不推荐windows-2016迁移到Windows 2019或Windows 2022。有关更多信息,请参见博客文章。Ubuntu20.04ubuntu-最新或Ubuntu-20.04Ubuntu18.04ubuntu- 18.04 macOS大SU11 macos-11 macOS -最新标签目前使用macOS 10.15跑步图像。macOS Catalina 10.15 macos-最新版或macos-10.15
https://stackoverflow.com/questions/69904746
复制