-
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.
- Loading branch information
Showing
5 changed files
with
203 additions
and
4 deletions.
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,37 @@ | ||
name: Trigger Target Repository Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- stage | ||
- testing | ||
|
||
jobs: | ||
notify: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Trigger Target Repository | ||
run: | | ||
BRANCH_NAME=${GITHUB_REF##*/} | ||
echo "Triggering deployment for branch: $BRANCH_NAME" | ||
# Make the API request and capture the response code | ||
RESPONSE=$(curl -s -o response.json -w "%{http_code}" -X POST \ | ||
-H "Authorization: token ${{ secrets.DEPLOY_PAT }}" \ | ||
-H "Accept: application/vnd.github.everest-preview+json" \ | ||
https://api.github.com/repos/navnorth/wp-nn-dot-com/dispatches \ | ||
-d "{\"event_type\": \"trigger-sync-theme\", \"client_payload\": {\"branch\": \"$BRANCH_NAME\"}}") | ||
echo "API Response Code: $RESPONSE" | ||
cat response.json | ||
# Exit with non-zero status if the response is 404 | ||
if [ "$RESPONSE" -eq 404 ]; then | ||
echo "Error: Repository not found (404)" | ||
exit 1 | ||
elif [ "$RESPONSE" -eq 422 ]; then | ||
echo "Error: Validation failed, or the endpoint has been spammed. (404)" | ||
exit 1 | ||
fi |
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
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,20 @@ | ||
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"34px","bottom":"0px"}}},"backgroundColor":"base","layout":{"type":"constrained"}} --> | ||
<div class="wp-block-group alignwide has-base-background-color has-background" | ||
style="padding-top:34px;padding-bottom:0px"> | ||
<!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between","flexWrap":"wrap"}} --> | ||
<div class="wp-block-group alignwide"> | ||
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}},"layout":{"type":"flex"}} --> | ||
<div class="wp-block-group"> | ||
<!-- wp:site-logo {"width":195 } /--> | ||
</div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:group {"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"left","alignSelf":"stretch"},"className":"header-navigation"} --> | ||
<div class="wp-block-group header-navigation"> | ||
<!-- wp:navigation {"layout":{"type":"flex","justifyContent":"right","orientation":"horizontal"},"style":{"spacing":{"margin":{"top":"0"},"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}}} /--> | ||
</div> | ||
<!-- /wp:group --> | ||
</div> | ||
<!-- /wp:group --> | ||
</div> | ||
<!-- /wp:group --> |
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
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