Skip to content

Commit

Permalink
ci(general): workflow added
Browse files Browse the repository at this point in the history
  • Loading branch information
vaivanov committed Sep 3, 2024
1 parent 960378a commit 4cf9c0c
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: prod

on:
push:
branches:
- main

jobs:
trigger:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
- name: Trigger Workflow
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ secrets.TARGET_REPO_OWNER }}/${{ secrets.TARGET_REPO_NAME }}/dispatches \
-d '{
"event_type":"trigger-workflow",
"client_payload":{
"unit":false,
"integration":true,
"branch":"${{ github.ref_name }}",
"env":"prod",
"hash":"${{ env.COMMIT_SHORT_SHA }}"
}
}'

0 comments on commit 4cf9c0c

Please sign in to comment.