GitHub Action is the platform to automate build, test and deployment of the code. GitHub Actions has below stages:
Event : This is triggered when code is updated or there is change in repo like updated PR ,creation of branch .
Workflows: Workflow is automated process which will run collection of the jobs. Workflows are defined in YAML file and stored in. github/workflows directory.
Jobs: This is task that is executed in workflow. There can be multiple jobs in workflow.
Runners : Process running on the server.
Building simple github Action workflow.
create action.yaml file under .github/workflow/action.yaml Contents of the file.
on:
push:
brances:
- main
jobs:
hello_world:
runs-on: ubuntu-latest
steps:
- run: echo "welcome to Github Action 2"
2. Below you can see in GitHub.
3. update the code and push and this will trigger job.