Skip to content

Commit

Permalink
common5
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Nov 24, 2023
1 parent 8c53dc4 commit 3759b5c
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 47 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Filter Issues CI/CD

on:
push:
branches: [main]
pull_request:
branches: [main, try_cron]
schedule:
- cron: "*/6 * * * *"

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- main
- try_cron
exclude:
- if: github.event_name != 'schedule' && matrix.branch == 'try_cron'
steps:
- name: checkout
if: (github.event_name == 'schedule')
uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}

- name: Install node required
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install dependencies
run: npm ci

- name: run hello.js
run: |
node ./hello.js
27 changes: 15 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: Main Workflow
# name: Main Workflow

on:
push:
branches:
- main
schedule:
- cron: "*/6 * * * *"
# on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
# schedule:
# - cron: "*/6 * * * *"

jobs:
main:
uses: ./.github/workflows/shared_steps.yml
with:
branch: main
# jobs:
# main:
# uses: ./.github/workflows/shared_steps.yml
# with:
# branch: main
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Release Workflow
# name: Release Workflow

on:
schedule:
- cron: "*/6 * * * *"
# on:
# schedule:
# - cron: "*/6 * * * *"

jobs:
try_cron:
uses: ./.github/workflows/shared_steps.yml
with:
branch: try_cron
# jobs:
# try_cron:
# uses: ./.github/workflows/shared_steps.yml
# with:
# branch: try_cron
52 changes: 26 additions & 26 deletions .github/workflows/shared_steps.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name: Shared Steps
# name: Shared Steps

on:
workflow_call:
inputs:
branch:
type: string
# on:
# workflow_call:
# inputs:
# branch:
# type: string

jobs:
build:
runs-on: ubuntu-latest
# jobs:
# build:
# runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}
# steps:
# - name: checkout
# uses: actions/checkout@v2
# with:
# ref: ${{ inputs.branch }}

- name: Get branch name
run: |
echo "Branch name from trigger: ${{ inputs.branch }}"
# - name: Get branch name
# run: |
# echo "Branch name from trigger: ${{ inputs.branch }}"

- name: Install node required
uses: actions/setup-node@v3
with:
node-version: 16.x
# - name: Install node required
# uses: actions/setup-node@v3
# with:
# node-version: 16.x

- name: Install dependencies
run: npm ci
# - name: Install dependencies
# run: npm ci

- name: run hello.js
run: |
node ./hello.js
# - name: run hello.js
# run: |
# node ./hello.js

0 comments on commit 3759b5c

Please sign in to comment.