Skip to content

Latest commit

 

History

History
68 lines (41 loc) · 3.3 KB

github-actions.md

File metadata and controls

68 lines (41 loc) · 3.3 KB

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

  • 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

FYI

  • Github actions by default has 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).

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