-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added generic workflow to deploy to corresponding environments
- Loading branch information
1 parent
6ae423e
commit 6d2be89
Showing
2 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Deploy UI and API | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: 'Deployment environment' | ||
required: true | ||
default: 'uat' | ||
type: choice | ||
options: | ||
- uat | ||
- prod | ||
|
||
jobs: | ||
deploy_ui_and_api: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check environment | ||
run: echo "Deploying to ${{ github.event.inputs.environment }} environment" | ||
|
||
# Deploy UI | ||
- name: Trigger UI Deployment | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const branchToDeploy = '${{ github.event.inputs.environment }}' === 'prod' ? 'main' : 'uat'; | ||
const response = await github.actions.createWorkflowDispatch({ | ||
owner: 'naumanzchaudhry', | ||
repo: 'tasker-ui', | ||
workflow_id: 'deploy.yml', | ||
ref: branchToDeploy, | ||
inputs: { | ||
environment: "${{ github.event.inputs.environment }}" | ||
} | ||
}); | ||
console.log('Triggered UI deployment:', response.status); | ||
# Deploy API | ||
- name: Trigger API Deployment | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const branchToDeploy = '${{ github.event.inputs.environment }}' === 'prod' ? 'main' : 'uat'; | ||
const response = await github.actions.createWorkflowDispatch({ | ||
owner: 'naumanzchaudhry', | ||
repo: 'tasker-api', | ||
workflow_id: 'deploy.yml', | ||
ref: branchToDeploy, | ||
inputs: { | ||
environment: "${{ github.event.inputs.environment }}" | ||
} | ||
}); | ||
console.log('Triggered API deployment:', response.status); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# TDD in Legacy Code Transformation | ||
# Tasker App - TDD in Legacy Code Transformation | ||
|
||
## Pipeline Dashboard | ||
|
||
|