Fix gh-pages update script
This commit is contained in:
parent
49df8778f9
commit
6393dbc91b
94
.github/scripts/on-pages.sh
vendored
94
.github/scripts/on-pages.sh
vendored
@ -85,53 +85,59 @@ function git_safe_upload_to_pages(){
|
||||
return $?
|
||||
}
|
||||
|
||||
EVENT_JSON=`cat $GITHUB_EVENT_PATH`
|
||||
|
||||
echo "GITHUB_EVENT_PATH: $GITHUB_EVENT_PATH"
|
||||
echo "EVENT_JSON: $EVENT_JSON"
|
||||
|
||||
pages_added=`echo "$EVENT_JSON" | jq -r '.commits[].added[]'`
|
||||
echo "added: $pages_added"
|
||||
pages_modified=`echo "$EVENT_JSON" | jq -r '.commits[].modified[]'`
|
||||
echo "modified: $pages_modified"
|
||||
pages_removed=`echo "$EVENT_JSON" | jq -r '.commits[].removed[]'`
|
||||
echo "removed: $pages_removed"
|
||||
|
||||
for page in $pages_added; do
|
||||
if [[ $page != "README.md" && $page != "docs/"* ]]; then
|
||||
continue
|
||||
fi
|
||||
echo "Adding '$page' to pages ..."
|
||||
if [[ $page == "README.md" ]]; then
|
||||
git_safe_upload_to_pages "index.md" "README.md"
|
||||
else
|
||||
git_safe_upload_to_pages "$page" "$page"
|
||||
fi
|
||||
done
|
||||
|
||||
for page in $pages_modified; do
|
||||
if [[ $page != "README.md" && $page != "docs/"* ]]; then
|
||||
continue
|
||||
fi
|
||||
echo "Modifying '$page' ..."
|
||||
if [[ $page == "README.md" ]]; then
|
||||
git_safe_upload_to_pages "index.md" "README.md"
|
||||
else
|
||||
git_safe_upload_to_pages "$page" "$page"
|
||||
fi
|
||||
done
|
||||
# At some point github stopped providing a list of edited file
|
||||
# but we also stopped havong documentation in md format,
|
||||
# so we can skip this portion safely and update just the index
|
||||
|
||||
for page in $pages_removed; do
|
||||
if [[ $page != "README.md" && $page != "docs/"* ]]; then
|
||||
continue
|
||||
fi
|
||||
echo "Removing '$page' from pages ..."
|
||||
if [[ $page == "README.md" ]]; then
|
||||
git_remove_from_pages "README.md" > /dev/null
|
||||
else
|
||||
git_remove_from_pages "$page" > /dev/null
|
||||
fi
|
||||
done
|
||||
# EVENT_JSON=`cat $GITHUB_EVENT_PATH`
|
||||
|
||||
# echo "GITHUB_EVENT_PATH: $GITHUB_EVENT_PATH"
|
||||
# echo "EVENT_JSON: $EVENT_JSON"
|
||||
|
||||
# pages_added=`echo "$EVENT_JSON" | jq -r '.commits[].added[]'`
|
||||
# echo "added: $pages_added"
|
||||
# pages_modified=`echo "$EVENT_JSON" | jq -r '.commits[].modified[]'`
|
||||
# echo "modified: $pages_modified"
|
||||
# pages_removed=`echo "$EVENT_JSON" | jq -r '.commits[].removed[]'`
|
||||
# echo "removed: $pages_removed"
|
||||
|
||||
# for page in $pages_added; do
|
||||
# if [[ $page != "README.md" && $page != "docs/"* ]]; then
|
||||
# continue
|
||||
# fi
|
||||
# echo "Adding '$page' to pages ..."
|
||||
# if [[ $page == "README.md" ]]; then
|
||||
# git_safe_upload_to_pages "index.md" "README.md"
|
||||
# else
|
||||
# git_safe_upload_to_pages "$page" "$page"
|
||||
# fi
|
||||
# done
|
||||
|
||||
# for page in $pages_modified; do
|
||||
# if [[ $page != "README.md" && $page != "docs/"* ]]; then
|
||||
# continue
|
||||
# fi
|
||||
# echo "Modifying '$page' ..."
|
||||
# if [[ $page == "README.md" ]]; then
|
||||
# git_safe_upload_to_pages "index.md" "README.md"
|
||||
# else
|
||||
# git_safe_upload_to_pages "$page" "$page"
|
||||
# fi
|
||||
# done
|
||||
|
||||
# for page in $pages_removed; do
|
||||
# if [[ $page != "README.md" && $page != "docs/"* ]]; then
|
||||
# continue
|
||||
# fi
|
||||
# echo "Removing '$page' from pages ..."
|
||||
# if [[ $page == "README.md" ]]; then
|
||||
# git_remove_from_pages "README.md" > /dev/null
|
||||
# else
|
||||
# git_remove_from_pages "$page" > /dev/null
|
||||
# fi
|
||||
# done
|
||||
|
||||
echo
|
||||
echo "DONE!"
|
||||
|
1
.github/workflows/gh-pages.yml
vendored
1
.github/workflows/gh-pages.yml
vendored
@ -7,7 +7,6 @@ on:
|
||||
- pages
|
||||
paths:
|
||||
- 'README.md'
|
||||
- 'docs/**'
|
||||
- '.github/scripts/on-pages.sh'
|
||||
- '.github/workflows/gh-pages.yml'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user