6060 - name : Copy HTML directories
6161 run : |
6262 ls -asl
63- for i in `ls -d *`
63+ for i in */
6464 do
6565 echo "Git adding ${i}"
6666 git add "${i}"
@@ -85,25 +85,26 @@ jobs:
8585 # If any of these commands fail, fail the build.
8686 def_branch=$(gh api "repos/${GITHUB_REPOSITORY}" --jq ".default_branch")
8787 html_url=$(gh api "repos/${GITHUB_REPOSITORY}/pages" --jq ".html_url")
88- # Beware ugly quotation mark avoidance in the foll lines.
89- echo '<!DOCTYPE html>' > index.html
90- echo '<html>' >> index.html
91- echo ' <head>' >> index.html
92- echo ' <title>Redirect to documentation</title>' >> index.html
93- echo ' <meta charset="utf-8">' >> index.html
94- echo ' <meta http=equiv="refresh" content="3; URL='${html_url}${def_branch}'/index.html">' >> index.html
95- echo ' <link rel="canonical" href="'${html_url}${def_branch}'/index.html">' >> index.html
96- echo ' <script language="javascript">' >> index.html
97- echo ' function redirect() {' >> index.html
98- echo ' window.location.assign("'${html_url}${def_branch}'/index.html")' >> index.html
99- echo ' }' >> index.html
100- echo ' </script>' >> index.html
101- echo ' </head>' >> index.html
102- echo ' <body onload="redirect()">' >> index.html
103- echo ' <p>Please follow the link to the <a href="'${html_url}${def_branch}'/index.html">' >> index.html
104- echo ${def_branch}'</a> branch documentation.</p>' >> index.html
105- echo ' </body>' >> index.html
106- echo '</html>' >> index.html
88+ cat > index.html << EOF
89+ <!DOCTYPE html>
90+ <html>
91+ <head>
92+ <title>Redirect to documentation</title>
93+ <meta charset="utf-8">
94+ <meta http=equiv="refresh" content="3; URL="${html_url}${def_branch}/index.html"
95+ <link rel="canonical" href="'${html_url}${def_branch}/index.html">
96+ <script language="javascript">
97+ function redirect() {
98+ window.location.assign("${html_url}${def_branch}/index.html")
99+ }
100+ </script>
101+ </head>
102+ <body onload="redirect()">
103+ <p>Please follow the link to the <a href="${html_url}${def_branch}/index.html">
104+ ${def_branch}'</a> branch documentation.</p>
105+ </body>
106+ </html>
107+ EOF
107108 git add index.html
108109 - name : Commit changes to the GitHub Pages branch
109110 run : |
0 commit comments