Github Actions are used to automate venture administration duties through the use of workflows.
- Every Workflow incorporates a collection of duties, that are applied or run routinely everytime when the workflow runs.
Github Motion is a CI/CD(Steady Integration and Steady Supply) platform that means that you can automate your construct, check and deployment pipelines
The Parts of Github Actions:
1.Workflow:
- Workflow is a configurable automated course of that can run a number of jobs,
- outlined by a YAML file/Syntax,
- and it is positioned inside
.github/workflows
path
2.Occasions:
- it’s One thing that triggers Workflows
3.Jobs:
- Job is a set of steps in a workflow, every step is both a
Shell script
or anmotion
- Steps are executed so as, and are depending on one another.
- Information Sharing mechanism is built-in into the steps, since they’re depending on one another
4.Actions:
- Customized utility for the Github Actions platform that performs a posh however continuously repeated duties
5.Runners:
- is a server that runs your workflow when they’re triggered.
Allow us to Perceive the Workflow file(YAML):
identify: learn-github-actions
- it would seem within the ‘Actions’ tab of the Github Repository
- it’s an non-compulsory step
run-name: ${{github.actor}} is studying Github actions
- it specifies the identify of workflow run, that can seem within the checklist of workflow runs on ‘Actions’ Tab
on: [push]
- specifies the set off for the Workflow
jobs:
- Teams all the roles that run within the learn-github-action workflow
check-bats-version:
- Defines a job named
check-bats-version
. The kid keys will outline properties of the job.
runs-on: ubuntu-latest
- configures the job to run on the most recent model of the Ubuntu Linux runner(Recent digital machine hosted by Github)
steps:
- teams collectively all of the steps that runs on this job. Every merchandise nested underneath this part is a separate
motion
or ashell script
.
-uses: actions/checkout@v4
- The
makes use of
key phrase specifies that this step will runv4
of theactions/checkout
motion. - This actions checks out your repository onto the runner, permitting you to run scripts or different actions towards your code.
-uses: actions/setup-node@v3
with:
node-version: '14'
- This step makes use of the
actions/setup-node@v3
motion to put in the required model of the Node that might be used for the venture - This places each the
node
&npm
instructions in your Path
-run: npm set up -g bats
- The run key phrase tells the job to execute a command on the Runner.
- On this case, you are utilizing
npm
to put inbats
software program testing package deal.
-run:bats-v
- Lastly you will run the
bats
command with a parameter that outputs the software program model.
Thanks for studying the tutorial!