Skip to content

Commit

Permalink
Merge pull request #2 from nesi/advisory-heron
Browse files Browse the repository at this point in the history
Advisory heron
  • Loading branch information
CallumWalley authored Sep 27, 2024
2 parents 14090d8 + 4a0596d commit 73a00da
Show file tree
Hide file tree
Showing 13 changed files with 2,314 additions and 302 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@

Description of current CI workflow.

## [fetch_includes.yml](fetch_includes.yml)

Retrieves dynamically generated content from external sources.

Currently retrieves:
- Software module list from [modules-list](https://github.com/nesi/modules-list).
- Glossary, spellcheck dictionary and snippets from [nesi-wordlist](https://github.com/nesi/nesi-wordlist)

It then runs [link_apps_pages.py](#link_apps_pagespy).

All modified files are added to a new branch called `new-assets` and merged into main.

In theory, all this could be done at deployment, but I wanted to make sure that changes to these remote files didn't break anything.

## [checks.yml](checks.yml)

A series of QA checks run on the documentation.
Expand Down
141 changes: 73 additions & 68 deletions .github/workflows/demo_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,73 @@
# Requires some setup


# name: Deploy PR branches
# on:
# pull_request:
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TARGET_REPO: "support-docs-dev"
# TARGET_OWNER: "CallumWalley"
# WORKFLOW_ID: "deploy.yml"
# DEPLOY_URL: "https://callumwalley.github.io/support-docs-dev"
# 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":{"pr-branches":"${{ github.event.pull_request.head.ref }}", "use-cache":"true"}}'
# - name: Wait for Workflow Action
# run: |
# # Just give a minute or so to deploy
# # sleep 90
# # 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: 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}/${HEAD}\">${DEPLOY_URL}/${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}/${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><em>Test site may take a minute or so to deploy after PR Open or Update.</em>"
# (gh pr comment ${HEAD} --edit-last --body "${msg}") || (gh pr comment ${HEAD} --body "${msg}")
# echo "::info title=Deploy successful::${DEPLOY_URL}/${HEAD}"
name: Deploy PR branches
on:
pull_request:
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\":}"
- 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: 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}"
55 changes: 0 additions & 55 deletions .github/workflows/fetch_includes.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ public/*
production/*
**.pyc
.venv/*
dictionary.dic
6 changes: 6 additions & 0 deletions checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Spellcheck pipeline settings can be modified in [.spellcheck.yml](../.spellcheck
List of custom words can be found in [dictionary.txt](../docs/assets/glossary/dictionary.txt),
however you **should not edit this manually**, see [adding-words-to-dictionary](../docs/CONTRIBUTING.md#adding-words-to-dictionary).

This list is automatically updated daily in the case of docs.nesi, but not the other sites.
You should occasionally run
`wget -O docs/assets/glossary/dictionary.txt https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/dictionary.txt`
to keep it up to date.


### Limitations

Spellchecker does not provide output lineumber / column.
Expand Down
14 changes: 0 additions & 14 deletions docs/assets/glossary/Glossary.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/glossary/README.md

This file was deleted.

57 changes: 0 additions & 57 deletions docs/assets/glossary/dictionary.md

This file was deleted.

Loading

0 comments on commit 73a00da

Please sign in to comment.