Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
6393dbc9
Commit
6393dbc9
authored
Jul 19, 2021
by
me-no-dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gh-pages update script
parent
49df8778
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
48 deletions
+53
-48
.github/scripts/on-pages.sh
.github/scripts/on-pages.sh
+53
-47
.github/workflows/gh-pages.yml
.github/workflows/gh-pages.yml
+0
-1
No files found.
.github/scripts/on-pages.sh
View file @
6393dbc9
...
...
@@ -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
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
git_safe_upload_to_pages
"index.md"
"README.md"
# 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
# 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!"
.github/workflows/gh-pages.yml
View file @
6393dbc9
...
...
@@ -7,7 +7,6 @@ on:
-
pages
paths
:
-
'
README.md'
-
'
docs/**'
-
'
.github/scripts/on-pages.sh'
-
'
.github/workflows/gh-pages.yml'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment