-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from nesi/CallumWalley-patch-1
Test PR
- Loading branch information
Showing
2 changed files
with
51 additions
and
30 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: Deploy PR branches | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TARGET_REPO: "mkdocs-demo-deploy" | ||
|
@@ -15,35 +16,39 @@ jobs: | |
name: Trigger test deployments | ||
runs-on: ubuntu-latest | ||
steps: | ||
# - name: Trigger Workflow in Another Repository | ||
# run: | | ||
# set -x | ||
# set -o xtrace | ||
# curl -L \ | ||
# -X POST \ | ||
# -H "Accept: application/vnd.github+json" \ | ||
# -H "Authorization: Bearer ${{ secrets.PAT }}" \ | ||
# -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
# https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/dispatches \ | ||
# -d "{\"event_type\":\"deploy\",\"client_payload\":}" | ||
- name: Run 'deploy.yml' Workflow | ||
uses: convictional/[email protected] | ||
with: | ||
owner: ${TARGET_OWNER} | ||
repo: ${TARGET_REPO} | ||
github_token: ${{ secrets.PAT }} | ||
workflow_file_name: deploy.yml | ||
client_payload: '{"targets":"${GITHUB_REPOSITORY}:${HEAD}", "use-cache":"true"}' | ||
- name: Trigger Workflow in Another Repository | ||
run: | | ||
set -x | ||
set -o xtrace | ||
curl -L \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ secrets.PAT }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/dispatches \ | ||
-d "{\"event_type\":\"deploy\",\"client_payload\":{\"targets\":\"${GITHUB_REPOSITORY}:${HEAD}\", \"use-cache\":\"true\"}}" | ||
# This would be better if it worked | ||
# - name: Run 'deploy.yml' Workflow | ||
# uses: convictional/[email protected] | ||
# with: | ||
# owner: ${TARGET_OWNER} | ||
# repo: ${TARGET_REPO} | ||
# github_token: ${{ secrets.PAT }} | ||
# workflow_file_name: deploy.yml | ||
# client_payload: '{\"targets\":\"${GITHUB_REPOSITORY}:${HEAD}\", \"use-cache\":\"true\"}' | ||
# - name: Wait for Workflow Action | ||
# run: | | ||
# # Just give a minute or so to deploy | ||
# # sleep 60 | ||
# curl -L \ | ||
# -X POST \ | ||
# -H "Accept: application/vnd.github+json" \ | ||
# -H "Authorization: Bearer ${{ secrets.PAT }}" \ | ||
# -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
# https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/actions/runs/deploy.yml | ||
- name: Wait for Workflow Action | ||
run: | | ||
# Just give a minute or so to deploy | ||
sleep 60 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
|
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