For sample workflow files, refer repos: https://github.com/sahilrajput03/sahilrajput03/, https://github.com/sahilrajput03/devopswithkubernetes
Learn Act: Click here - You may fall a couple of times (often boils down to a billion times failures, so use act
now!).
Quick
Workflow Syntax Documentation: Click here to learn every syntax of github actions
This is all what you need to read to understand the workflow’s syntax. Q. How to navigate to Workflow Syntax Documentation page from home docs: Click on Github Actions topic @ docs.github.com/en, then click on topic Workflow syntax for GitHub Actions under Popular section.
General
My example Github Actions’s configurations
Cron job for sending thought messages via telegram bot @ github.com/sahilrajput03/sahilrajput03/tree/master/.github.
This project includes usage of act
to help us run and debug github actions at the speed of light locally. Yo!
FYI
secrets.GITHUB_TOKEN
secret which is helpful to authenticate on our basis in the github workflows. Click here. You may see the usage in the same previous link or click here which is a course material example from Ch4 Part4@dwk course).If you want to read about filter pattern, you can read @ here.
The path matchingin github actions is kind of so vagues coz:
on:
push:
branches:
- main
paths:
- '.github/workflows/project-backend.yml'
- './exercises/ex4-08/ex4-06/ex2-08-statefulsets/ex2-02/**'
above won’t work coz you have ./ in the begining of the exercises path and that causes it to not tract our desired folder, so instead, we must do like below (remove the ./
) and it’ll work:
...
- 'exercises/ex4-08/ex4-06/ex2-08-statefulsets/ex2-02/**'
...
Source: Docs - Environment variables
Image 1:
Image 2:
Creating Secrets in Gihtub Actions