sahilrajput.com

Learn github actions

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

General

My example Github Actions’s configurations

FYI

Can’t see getting your workflow run on changing files in directories you have set track to ?

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/**'
...

Using environment variables in github actions (all levels i.e., workflow, job, step levels)

Source: Docs - Environment variables

Image 1:

image

Image 2:

image

Creating Secrets in Gihtub Actions

image