-
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
1 parent
d78895b
commit 4dd58ab
Showing
12 changed files
with
166 additions
and
53 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,78 @@ | ||
name: Deploy PR branches | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TARGET_REPO: "mkdocs-demo-deploy" | ||
TARGET_OWNER: "CallumWalley" | ||
WORKFLOW_ID: "deploy.yml" | ||
DEPLOY_URL: "https://callumwalley.github.io/mkdocs-demo-deploy" | ||
HEAD: ${{ github.event.pull_request.head.ref }} | ||
permissions: write-all | ||
jobs: | ||
demo-deploy: | ||
continue-on-error: true | ||
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\":{\"targets\":\"${GITHUB_REPOSITORY}:${HEAD}\", \"use-cache\":\"true\"}}" | ||
# This would be better if it worked | ||
# - name: Run 'deploy.yml' Workflow | ||
# uses: convictional/trigger-workflow-and-wait@v1.6.1 | ||
# 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: | | ||
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: | ||
fetch-depth: 0 | ||
- name: Post messages open requests | ||
run: | | ||
msg="Test deployment available at <a href=\"${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}\">${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}</a>" | ||
changed_pages="$(git diff --name-only origin/main -- '*.md')" | ||
# Logic for truncating out long sections commented out. | ||
# maxlines=-5 | ||
if [ -n "${changed_pages}" ]; then | ||
msg="${msg}<br><br>Seems the following pages differ;<br><ul>" | ||
for f in ${changed_pages};do | ||
# maxlines=((maxlines+1)) | ||
#if [ ${maxlines} -lt 1 ]; then | ||
g=${f#*/}; h=${g%.*} | ||
msg="${msg}<li><a href=\"${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}/${h}\" target=_blank>${h##*/}</a></li>" | ||
#fi | ||
done | ||
# if [ ${maxlines} -gt 0 ];then | ||
# msg="${msg}<li> ... and ${maxlines} more.</li>" | ||
# fi | ||
msg="${msg}</ul>" | ||
fi | ||
msg="${msg}<br><br><em><a href="${DEPLOY_URL}">See all deployed demo sites</a></em>" | ||
(gh pr comment ${HEAD} --edit-last --body "${msg}") || (gh pr comment ${HEAD} --body "${msg}") | ||
echo "::info title=Deploy successful::${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}" |
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
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
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
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,5 +1,3 @@ | ||
#!/bin/bash | ||
|
||
# Updates dictionary for spellcheck | ||
|
||
wget -O docs/assets/glossary/dictionary.txt https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/dictionary.txt | ||
( cd "${PWD/\/docs\/*/}" && wget -O docs/assets/glossary/dictionary.txt https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/dictionary.txt ) |
This file was deleted.
Oops, something went wrong.
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
Empty file.