Github actions - Workflows

Workflows define the event that triggers actions.

Workflows define which actions to run.

Repositories can contain multiple workflows.

Events:

  • push
  • pull request
  • release

one event example:

on: push

on: release

multiple events example:

?on: [push, pull request]

jobs:

  • Workflows must have at least one job
  • Each job must have a unique identifier
  • Job identifier must start with a letter or underscore
  • Jobs in in a parallel by default

Example:

name: First action

on:

push:

paths:

- '**.md'

jobs:

ubuntu:

name: First job

runs-on: ubuntu-latest

steps:

- run: date

windows:

name: Second job

runs-on: windows-latest

steps:

- run: date

macos:

name: Third job

runs-on: macos-latest

steps:

- run: date

depends:

name: Dependencies job

needs: [ubuntu, windows, macos]

runs-on: ubuntu-latest

steps:

- run: echo "you are done the mission !"

Explaine :


要查看或添加评论,请登录

社区洞察

其他会员也浏览了