Minimal GitHub Actions Workflows#
Sample Workflow Definition#
1# This is a minimal viable GitHub Action Workflow
2name: 01_02_minimal_workflow
3# Controls when the action will run.
4# Reference:
5# - on: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
6# - Events that trigger workflows: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
7on:
8 # To enable a workflow to be triggered manually, you need to configure the workflow_dispatch event.
9 # - workflow_dispatch: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
10 # - Manually running a workflow: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
11 # Allows you to run this workflow manually from the GitHub Actions tab
12 workflow_dispatch:
13# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14jobs:
15 # This workflow contains a single job called "build"
16 build:
17 # The type of runner that the job will run on
18 runs-on: ubuntu-latest
19 # Steps represent a sequence of tasks that will be executed as part of the job
20 steps:
21 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22 - uses: actions/checkout@v3 # https://github.com/marketplace/actions/checkout
23 # Runs a single command using the runners shell
24 - name: Run a one-line script
25 run: echo Hello, world!
26 # Runs a set of commands using the runners shell
27 - name: Run a multi-line script
28 run: |
29 echo build your project
30 echo test your project
31 echo deploy your project