xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Github Actions All In One

Github Actions All In One

https://github.com/features/actions

https://github.com/marketplace?type=actions

https://docs.github.com/en/developers/github-marketplace

.github/workflows/main.yml

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

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

# 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"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # 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

      # Runs a single command using the runners shell
      - name: Run a one-line script
        run: echo Hello, world!

      # Runs a set of commands using the runners shell
      - name: Run a multi-line script
        run: |
          echo Add other actions to build,
          echo test, and deploy your project.

on & jobs

zh-Hans

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

name: CI

# 控制 action 何时运行
# 在 push 或 pull 请求时触发工作流程事件,但仅针对  master 分支
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

# 一个 workflow 运行由可以串行或并行运行的一个或多个 jobs 组成
jobs:
  # 此工作流程仅包含一个名为 "build" 的 job
  build:
    # job 将运行的 runner 类型(执行的系统环境 Linux/ macOS / Windows)
    runs-on: ubuntu-latest

    # 步骤表示将作为 job 一部分执行的一系列 tasks
    steps:
      # 在 $GITHUB_WORKSPACE下检出你的repository,以便你的 job 可以访问它
      - uses: actions/checkout@v2

      # 使用 runners shell 运行单个命令
      - name: Run a one-line script
        run: echo 正在执行单个命令!

      # 使用 runners shell 运行一组命令
      - name: Run a multi-line script
        run: |
          echo 正在执行多个命令的 lint
          echo 正在执行多个命令的 test
          echo 正在执行多个命令的 build
          echo 正在执行多个命令的 deploy
          echo 正在执行多个命令的 npm publish

demos

.github/workflows/zh-Hans.yml

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

name: 🚀 DevOps 👻

# 控制 action 何时运行
# 在 push 或 pull 请求时触发工作流程事件,但仅针对  master 分支
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

# 一个 workflow 运行由可以串行或并行运行的一个或多个 jobs 组成
jobs:
  # 此工作流程仅包含一个名为 "build" 的 job
  build:
    # job 将运行的 runner 类型(执行的系统环境 Linux/ macOS / Windows)
    runs-on: ubuntu-latest

    # 步骤表示将作为 job 一部分执行的一系列 tasks
    steps:
      # 在 $GITHUB_WORKSPACE下检出你的repository,以便你的 job 可以访问它
      - uses: actions/checkout@v2

      # 使用 runners shell 运行单个命令 
      - name: Run a one-line script ✅ 👨🏻‍💻
        run: echo 正在执行单个命令! 

      # 使用 runners shell 运行一组命令
      - name: Run a multi-line script ✅ 👨🏻‍💻
        run: |
          echo 正在执行多个命令的 lint
          echo 正在执行多个命令的 test
          echo 正在执行多个命令的 build
          echo 正在执行多个命令的 deploy
          echo 正在执行多个命令的 npm publish
          echo finished 🎉

Ci/CD

DevOps

npm install


npm publish


dart package

publish package


testing

jest


how to publish a GitHub Action to the marketplace?

https://github.com/marketplace/actions/jest-reporter

https://github.com/tanmen/jest-reporter

refs



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2020-09-07 12:30  xgqfrms  阅读(289)  评论(8编辑  收藏  举报