Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment workflow #109

Merged
merged 3 commits into from
Nov 5, 2024
Merged
Changes from all commits
Commits
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
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}}"
Loading