Рет қаралды 186
When you create a GitHub Action you can specify when it runs, this is called a trigger. You can specify triggers such as when new code is pushed to the repository, or when a pull request is actioned the workflow will spin into action.
Usually these triggers are set so they kick off when a change happens to a specific branch. But you can take that down another level. You can specific if a change happens to a specific directory or path within a branch then the workflow or a specific Step within a Job will kick start.
In this video we are going to explore this concept in detail.
Documentation Reference:
=======================
github.com/dorny/paths-filter
Workflow Code:
==============
name: selective_run
on:
push:
jobs:
notification:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Execution decider
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src_f1:
- 'src/function1/**'
src_f2:
- 'src/function2/**'
- name: Dummy Step1
if: steps.changes.outputs.src_f1 == 'true'
run: echo "Hello, World1!"
- name: Dummy Step2
if: steps.changes.outputs.src_f2 == 'true'
run: echo "Hello, World2!"
Check this playlist for more Data Engineering related videos:
• Demystifying Data Engi...
Apache Kafka form scratch
• Apache Kafka for Pytho...
Messaging Made Easy: AWS SQS Playlist
• Messaging Made Easy: A...
Snowflake Complete Course from scratch with End-to-End Project with in-depth explanation--
doc.clickup.com/37466271/d/h/...
Explore our vlog channel:
/ @funwithourfam
#githubactions #aws #cicd #github #workflow