Skip to content

Commit

Permalink
Merge pull request #61 from teqbench/refactor/update_workflows
Browse files Browse the repository at this point in the history
Update workflows
  • Loading branch information
devops-teqbench authored Jan 4, 2024
2 parents fd88961 + 37fbe39 commit 6fab1f6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 13 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@ on:
workflow_dispatch:

jobs:
ci:
name: CI
uses: teqbench/teqbench.devops.githhub.workflows/.github/workflows/ci.yml@main
# This not the most optimal solution, however, as of 1/4/24, cannot limit the workflow_dispatch to a specific branch via the UI.
# Also, this is extra code to copy/paste into other repo workflow files. Revisit at a later time to improve.
validate-dispatch-inputs:
name: Validate Dispatch Inputs
runs-on: ubuntu-latest
steps:
- name: Validate Main Branch Selection
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
run: |
echo "This workflow can only be initiated using the 'main' branch."
exit 1
build:
name: Build
needs: validate-dispatch-inputs
uses: teqbench/teqbench.devops.githhub.workflows/.github/workflows/build-with-concurrency.yml@main
secrets: inherit
with:
ci_type: 'build-manual'


4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: CI
# TeqBench - CI Workflow - PR merge initiates a CI workflow.

on:
pull_request:
pull_request:
types: [closed]
branches:
- main

jobs:
ci:
name: CI
uses: teqbench/teqbench.devops.githhub.workflows/.github/workflows/ci.yml@main
uses: teqbench/teqbench.devops.githhub.workflows/.github/workflows/build-with-concurrency.yml@main
secrets: inherit
26 changes: 20 additions & 6 deletions .github/workflows/release-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,34 @@ name: Release & Deploy
on:
workflow_dispatch:
inputs:
# This not the most optimal solution, however, as of 1/4/24, no (apparent) way to share common workflow display input.
# So, this is extra code to copy/paste into other repo workflow files. Revisit at a later time to improve; maybe use GitHub project
# boards/tickets to initiate a release/deployment, no clear option yet.
release_type:
type: choice
description: Release Type
options:
options:
- MAJOR
- MINOR
- PATCH

jobs:
ci:
name: CI
uses: teqbench/teqbench.devops.githhub.workflows/.github/workflows/ci.yml@main
# This not the most optimal solution, however, as of 1/4/24, cannot limit the workflow_dispatch to a specific branch via the UI.
# Also, this is extra code to copy/paste into other repo workflow files. Revisit at a later time to improve.
validate-dispatch-inputs:
name: Validate Dispatch Inputs
runs-on: ubuntu-latest
steps:
- name: Validate Main Branch Selection
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
run: |
echo "This workflow can only be initiated using the 'main' branch."
exit 1
release_deploy:
name: Release & Deploy
needs: validate-dispatch-inputs
uses: teqbench/teqbench.devops.githhub.workflows/.github/workflows/release-deploy.yml@main
secrets: inherit
with:
ci_type: 'build-release-deploy'
release_type: ${{ github.event.inputs.release_type }}

0 comments on commit 6fab1f6

Please sign in to comment.