Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
44c6e1c
Create main.yml
Shasivadhan Aug 4, 2025
027937e
Update main.yml
Shasivadhan Aug 4, 2025
9986b62
Update main.yml
Shasivadhan Aug 4, 2025
1dd0315
Update cicd.yml
Shasivadhan Aug 4, 2025
b0d7e7c
Update main.yml
Shasivadhan Aug 4, 2025
23e4a28
Update main.yml
Shasivadhan Aug 4, 2025
172ea35
Update main.yml
Shasivadhan Aug 4, 2025
2e869a9
Update main.yml
Shasivadhan Aug 4, 2025
50ef6b2
Create fileworkflow
Shasivadhan Aug 4, 2025
2e6aa0e
Update main.yml
Shasivadhan Aug 4, 2025
76f49f6
Update main.yml
Shasivadhan Aug 4, 2025
f30d0b5
Merge pull request #3 from Shasivadhan/Shasivadhan-patch-1
Shasivadhan Aug 4, 2025
c7e4a97
Update main.yml
Shasivadhan Aug 4, 2025
4cec365
Merge pull request #2 from Shasivadhan/wrokflow
Shasivadhan Aug 4, 2025
3d1561e
Update fileworkflow
Shasivadhan Aug 4, 2025
f01469e
Merge pull request #4 from Shasivadhan/wrokflow
Shasivadhan Aug 4, 2025
d0f23b4
Update main.yml
Shasivadhan Aug 4, 2025
0466dab
Update main.yml
Shasivadhan Aug 4, 2025
53ebff6
Update main.yml
Shasivadhan Aug 4, 2025
c889b0e
Update fileworkflow
Shasivadhan Aug 4, 2025
67a12b3
Update fileworkflow
Shasivadhan Aug 4, 2025
3928cd3
Delete .github/workflows/cicd.yml
Shasivadhan Aug 4, 2025
070d7af
Create test
Shasivadhan Aug 4, 2025
e04254c
Delete fileworkflow
Shasivadhan Aug 4, 2025
6b4b3dd
Update main.yml
Shasivadhan Aug 4, 2025
09265f2
file deleted
Shasivadhan Aug 4, 2025
0716d32
Merge pull request #6 from Shasivadhan/workflowmodified
Shasivadhan Aug 4, 2025
ff0c20b
Create testpullopenstatus
Shasivadhan Aug 4, 2025
00dae48
Merge pull request #7 from Shasivadhan/wrokflow
Shasivadhan Aug 4, 2025
99a8112
Update main.yml
Shasivadhan Aug 5, 2025
a0c66cf
Update main.yml
Shasivadhan Aug 5, 2025
afa3091
Update main.yml
Shasivadhan Aug 5, 2025
60dcfe3
Update main.yml
Shasivadhan Aug 5, 2025
1c1be14
Create push.yml
Shasivadhan Aug 5, 2025
faf4cf7
Create push-issues.yml
Shasivadhan Aug 5, 2025
026bc23
Create combined.yml
Shasivadhan Aug 5, 2025
08bdf58
Create manual.yml
Shasivadhan Aug 5, 2025
a390331
Create pr-all.yml
Shasivadhan Aug 5, 2025
e1b9e2b
Create filters.yml
Shasivadhan Aug 5, 2025
cf3612c
Create tags.yml
Shasivadhan Aug 6, 2025
88175b3
Update tags.yml
Shasivadhan Aug 6, 2025
837ef6d
Update tags.yml
Shasivadhan Aug 6, 2025
692393a
updated all yaml files
Shasivadhan Aug 6, 2025
1737ef8
Create cicd.yml
Shasivadhan Aug 6, 2025
eec7e18
updated cicd
Shasivadhan Aug 6, 2025
76f1aa1
Create java.yml
Shasivadhan Aug 6, 2025
154b8c5
Update cicd.yml
Shasivadhan Aug 6, 2025
d865ed2
Update cicd.yml
Shasivadhan Aug 6, 2025
6baf7be
Update java.yml
Shasivadhan Aug 6, 2025
ab7d98a
Create node.yml
Shasivadhan Aug 6, 2025
1d16e54
Update node.yml
Shasivadhan Aug 6, 2025
8dc225f
Update node.yml
Shasivadhan Aug 6, 2025
4212b6a
Update cicd.yml
Shasivadhan Aug 6, 2025
1225b6a
Update cicd.yml
Shasivadhan Aug 6, 2025
2a227e1
Create python.yml
Shasivadhan Aug 6, 2025
d04eff2
Create githubcontext.yml
Shasivadhan Aug 6, 2025
836e1df
Update githubcontext.yml
Shasivadhan Aug 6, 2025
5a2b831
Create github-context-conditions.yml
Shasivadhan Aug 6, 2025
afe54c8
Update github-context-conditions.yml
Shasivadhan Aug 6, 2025
49dc489
Update github-context-conditions.yml
Shasivadhan Aug 6, 2025
1a1b93d
Update github-context-conditions.yml
Shasivadhan Aug 6, 2025
16f0e5e
Update github-context-conditions.yml
Shasivadhan Aug 6, 2025
d5c1711
Update github-context-conditions.yml
Shasivadhan Aug 6, 2025
62ace65
Update github-context-conditions.yml
Shasivadhan Aug 6, 2025
cd3876f
Update github-context-conditions.yml
Shasivadhan Aug 6, 2025
b16c4c0
Create environment-variables.yml
Shasivadhan Aug 6, 2025
5646b98
Update environment-variables.yml
Shasivadhan Aug 6, 2025
0abaac3
Update environment-variables.yml
Shasivadhan Aug 6, 2025
4ab2bde
Update environment-variables.yml
Shasivadhan Aug 6, 2025
50c4e41
Create githubcontext
Shasivadhan Aug 6, 2025
ae89a2a
context fiels
Shasivadhan Aug 6, 2025
a8f4349
Revert "context fiels"
Shasivadhan Aug 6, 2025
58a1ebd
test conditions
Shasivadhan Aug 6, 2025
e8f5770
for manuul
Shasivadhan Aug 6, 2025
bf54089
Update environment-variables.yml
Shasivadhan Aug 6, 2025
9a55687
Update environment-variables.yml
Shasivadhan Aug 6, 2025
ee3aeee
Update environment-variables.yml
Shasivadhan Aug 6, 2025
2c6974f
Update environment-variables.yml
Shasivadhan Aug 6, 2025
0ac3fcb
Update environment-variables.yml
Shasivadhan Aug 6, 2025
8f0a7ff
Update environment-variables.yml
Shasivadhan Aug 6, 2025
4186b2e
Update environment-variables.yml
Shasivadhan Aug 6, 2025
eabf317
Update environment-variables.yml
Shasivadhan Aug 6, 2025
799ee64
Update environment-variables.yml
Shasivadhan Aug 6, 2025
1f6666b
Update environment-variables.yml
Shasivadhan Aug 6, 2025
8e96ba8
Update environment-variables.yml
Shasivadhan Aug 6, 2025
2e9e138
Update environment-variables.yml
Shasivadhan Aug 6, 2025
040eedc
Update environment-variables.yml
Shasivadhan Aug 6, 2025
f6f8904
Create env-hierarchy.yml
Shasivadhan Aug 6, 2025
e05a0eb
Create vars.yml
Shasivadhan Aug 6, 2025
b09f205
Update vars.yml
Shasivadhan Aug 6, 2025
ce7f57f
Update vars.yml
Shasivadhan Aug 6, 2025
e07ec19
Create secrets.yml
Shasivadhan Aug 6, 2025
70c43ea
Update secrets.yml
Shasivadhan Aug 6, 2025
53e4593
Update env-hierarchy.yml
Shasivadhan Aug 6, 2025
d6fe178
Update vars.yml
Shasivadhan Aug 6, 2025
4dbb7e7
Create env-or-vars.yml
Shasivadhan Aug 6, 2025
3eadb8c
Create multi-job-vars.yml
Shasivadhan Aug 6, 2025
68be8f0
Create combo.yml
Shasivadhan Aug 6, 2025
34c84f3
Create matrix.yml
Shasivadhan Aug 6, 2025
a7c7b30
Update matrix.yml
Shasivadhan Aug 6, 2025
7f6e177
Update matrix.yml
Shasivadhan Aug 6, 2025
a19d185
Update matrix.yml
Shasivadhan Aug 6, 2025
cb71a01
Update matrix.yml
Shasivadhan Aug 6, 2025
ef2aa75
Update matrix.yml
Shasivadhan Aug 6, 2025
3e0c47d
Create basic-matrix.yml
Shasivadhan Aug 6, 2025
8484320
Create all-matrix.yml
Shasivadhan Aug 6, 2025
6a5a824
Create indexed-matrix.yml
Shasivadhan Aug 6, 2025
1542479
Create matrix-max-parallel.yml
Shasivadhan Aug 6, 2025
787ff6d
Create total-matrix.yml
Shasivadhan Aug 6, 2025
846b72c
Create generate-info.yml
Shasivadhan Aug 6, 2025
76b8980
Create consume-info.yml
Shasivadhan Aug 6, 2025
8fad99a
Update generate-info.yml
Shasivadhan Aug 6, 2025
7606de1
Update github-context-conditions.yml
Shasivadhan Aug 7, 2025
6d8e196
Create mdtest
Shasivadhan Aug 7, 2025
dedd63c
Merge pull request #10 from Shasivadhan/wrokflow
Shasivadhan Aug 7, 2025
8dd0700
Update github-context-conditions.yml
Shasivadhan Aug 7, 2025
7d06c00
Update all-matrix.yml
Shasivadhan Aug 7, 2025
d0cad6f
Update generate-info.yml
Shasivadhan Aug 7, 2025
5fa86b3
Update generate-info.yml
Shasivadhan Aug 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/all-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: All Matrix Use Cases

on:
workflow_dispatch:

jobs:

# Use Case 1:
basic-matrix:
name: "Basic Matrix: ${{ matrix.os }} - Java ${{ matrix.java }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
java: [17, 20]
steps:
- name: Echo basic combo
run: |
echo "OS=${{ matrix.os }}, Java=${{ matrix.java }}"

# Use Case 2:
include-matrix:
name: "Include Matrix: ${{ matrix.os }} - Java ${{ matrix.java }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
java: 17
- os: windows-latest
java: 20
steps:
- name: Echo included pair
run: |
echo "Included pair: ${{ matrix.os }} - ${{ matrix.java }}"

# Use Case 3:
exclude-matrix:
name: "Exclude Matrix: ${{ matrix.os }} - Java ${{ matrix.java }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
java: [17, 20]
exclude:
- os: windows-latest
java: 20
steps:
- name: Echo allowed pair
run: |
echo "Allowed pair: ${{ matrix.os }} - ${{ matrix.java }}"

# Use Case 4:
custom-key-matrix:
name: "Custom Key Matrix: ${{ matrix.os }} - Mode ${{ matrix.mode }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
java: 17
mode: dev
- os: windows-latest
java: 20
mode: prod
steps:
- name: Echo custom-mode combo
run: |
echo "Running in ${{ matrix.mode }} mode with Java ${{ matrix.java }} on ${{ matrix.os }}"

# Use Case 5:
failfast-matrix:
name: "Fail-Fast Off Matrix: ${{ matrix.env }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env: [alpha, beta, prod]
steps:
- name: Simulate environment
run: |
echo "Running environment: ${{ matrix.env }}"
if [[ "${{ matrix.env }}" == "beta" ]]; then exit 1; fi
14 changes: 14 additions & 0 deletions .github/workflows/basic-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Basic Matrix

on:
workflow_dispatch:

jobs:
basic-matrix:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
java: [17, 20]
steps:
- run: echo "OS=${{ matrix.os }}, Java=${{ matrix.java }}"
191 changes: 48 additions & 143 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,153 +1,58 @@
name: CICD Pipeline
# File: .github/workflows/ci.yml
name: CI Pipeline

on:
# 1) Pushes to main
push:
branches: [ "main" ]
branches:
- main
paths-ignore:
- 'docs/**'
- '**/*.md'
- '**/*.txt'
# 2) Issue events (opened & edited)
issues:
types:
- opened
- edited
# 3) Pull requests (opened & new commits)
pull_request:
branches:
- main
types:
- opened
- synchronize
# 4) Manual dispatch with an environment input
workflow_dispatch:
inputs:
environment:
description: 'Which environment to deploy to'
required: true
default: 'staging'

jobs:
compile:
runs-on: self-hosted

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn compile

security-check:
runs-on: self-hosted
needs: compile

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Trivy Installation
run: |
sudo apt-get install -y wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update -y
sudo apt-get install -y trivy

- name: Trivy FS Scan
run: trivy fs --format table -o fs-report.json .

- name: Gitleaks Installation
run: sudo apt install gitleaks -y
- name: Gitleaks Code Scan
run: gitleaks detect source . -r gitleaks-report.json -f json
- uses: actions/checkout@v4
- name: Print Build
run: echo "Building for ${{ github.event_name }} event"

test:
runs-on: self-hosted
needs: security-check
name: Test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Unit Test Cases
run: mvn test

build_project_and_sonar_scan:
runs-on: self-hosted
needs: test
- uses: actions/checkout@v4
- name: Print Test
run: echo "Testing on ${{ runner.os }} via ${{ github.event_name }}"

deploy:
name: Deploy
runs-on: ubuntu-latest
if: ${{ github.event_name != 'issues' }} # optional: skip deploy on issue events
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build Project
run: mvn package
- name: Upload JAR artifact
uses: actions/upload-artifact@v4
with:
name: app-jar
path: target/*.jar

- uses: actions/checkout@v4
with:
# Disabling shallow clones is recommended for improving the relevancy of reporting
fetch-depth: 0
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v5.0.0 # Ex: v4.1.0, See the latest version at https://github.com/marketplace/actions/official-sonarqube-scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}

- name: SonarQube Quality Gate check
id: sonarqube-quality-gate-check
uses: sonarsource/sonarqube-quality-gate-action@master
with:
pollingTimeoutSec: 600
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}

buils_docker_image_and_push:
runs-on: self-hosted
needs: build_project_and_sonar_scan
steps:
- uses: actions/checkout@v4
- name: Download JAR artifact
uses: actions/download-artifact@v4
with:
name: app-jar
path: app # this will download JAR to ./app folder

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: adijaiswal/bankapp:latest
file: ./Dockerfile

deploy_to_kubernetes:
runs-on: self-hosted
needs: buils_docker_image_and_push
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Set up kubectl
uses: azure/setup-kubectl@v3
with:
version: latest
- name: Configure kubeconfig
run: |
mkdir -p $HOME/.kube
echo "${{ secrets.EKS_KUBECONFIG }}" > $HOME/.kube/config
- name: Deploy to EKS
run: |
kubectl apply -f ds.yml


- uses: actions/checkout@v4
- name: Print Deploy
run: |
echo "Deploying to ${{ github.event.inputs.environment || 'default' }}"
23 changes: 23 additions & 0 deletions .github/workflows/combo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 6 Combine Env Vars Secrets

on:
workflow_dispatch:

env: # Workflow-level env
GLOBAL_ENV: workflow-env

jobs:
combo-demo:
runs-on: ubuntu-latest

env: # Job-level env (can override workflow-level)
GLOBAL_ENV: job-env

steps:
- name: Print everything
run: |
echo "env.GLOBAL_ENV = ${{ env.GLOBAL_ENV }}"
echo "vars.MY_VAR = ${{ vars.MY_VAR }}"
echo "secrets.MY_SECRET = ${{ secrets.MY_SECRET }}"
env:
GLOBAL_ENV: step-env
19 changes: 19 additions & 0 deletions .github/workflows/consume-info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Consume Generated Info

on:
workflow_dispatch:

jobs:
# Call the reusable workflow
call-generate:
uses: ./.github/workflows/generate-info.yml

# Consume its outputs
consumer:
needs: call-generate
runs-on: ubuntu-latest
steps:
- name: Show the values
run: |
echo "Timestamp: ${{ needs.call-generate.outputs.current-time }}"
echo "Random number: ${{ needs.call-generate.outputs.random-number }}"
20 changes: 20 additions & 0 deletions .github/workflows/env-hierarchy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Env Override Levels - UC 2

on:
workflow_dispatch:

env:
LEVEL: workflow

jobs:
env-test:
runs-on: ubuntu-latest

env:
LEVEL: job

steps:
- name: Print env
run: echo "env.LEVEL = ${{ env.LEVEL }}"
env:
LEVEL: step
18 changes: 18 additions & 0 deletions .github/workflows/env-or-vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Fallback Env or Vars - Uc 4

on:
workflow_dispatch:

jobs:
fallback-demo:
runs-on: ubuntu-latest

steps:
- name: Step 1 – No env set (should fallback to vars)
run: echo "Value = ${{ env.MY_VAR || vars.MY_VAR }}"

- name: Step 2 – Env set (should override vars)
run: echo "Value = ${{ env.MY_VAR || vars.MY_VAR }}"
env:
MY_VAR: from-env

Loading