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 發布文章使用:只允許注冊用戶才可以訪問!



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM