Skip to content

Commit

Permalink
Deployment workflow (#109)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
shanice-skylight and pre-commit-ci[bot] authored Nov 5, 2024
1 parent c02c72e commit ffe2abd
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/target_workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Trigger Deployment Workflow

on:
workflow_dispatch:
inputs:
target_service:
description: "Input a service name (e.g., demo-app)"
required: true
target_version:
description: "Input a version (e.g., v1.0.0)"
required: true

jobs:
trigger:
runs-on: ubuntu-latest

steps:
- name: Trigger Deployment Workflow in PHDI-Playground Repository
run: |
# Set the required variables
repo_owner="REPOSITORY OWNER"
repo_name="REPOSITORY NAME"
event_type="trigger-workflow"
service=${{ github.event.inputs.target_service }}"
version="${{ github.event.inputs.target_version }}"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.DEPLOYMENT_WORKFLOW }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"service\": \"$service\", \"version\": \"$version\", \"unit\": false, \"integration\": true}}"

0 comments on commit ffe2abd

Please sign in to comment.