A workflow is an automated procedure that can be configured to execute one or more operations. Workflows are defined by a YAML file that is checked into your repository and run when prompted
by an event there, manually, or according to a set schedule.
The given main.yaml file is a basic example of workflow in GitHub.
name: GitHub Actions Demo
run-name: Shagun is testing out GitHub Actions 🚀
on: [push]
jobs:
build:
name: Basic Example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
The given workflow will run whenever new code is pushed to the repository.
There simple steps to create it:
1. Clone the repository to local system
2. You need to create .github/workflows folder inside your repository
3. Add main.yaml file under the workflows directory and paste the above code written
4. Create a new commit and push the code
5. Go to Github > Actions > Workflow.
Now you can see the created workflow as shown :