1 && $argv[1] == 'nodeploy') { $nodeploy = true; } /* Sanity checks */ system("sudo apt-get install graphviz screen >/dev/null"); system("echo \$GITHUB_TOKEN | gh auth login --with-token "); system("gh auth status"); system("git clone https://braindigitalis:\$PERSONAL_ACCESS_TOKEN@github.com/brainboxdotcc/dpp-web.git /home/runner/dpp-web >/dev/null"); chdir("/home/runner/work/DPP/DPP"); system("sudo cp /home/runner/dpp-web/doxygen /usr/local/bin/doxygen && sudo chmod ugo+x /usr/local/bin/doxygen"); chdir("docpages"); system("git config --global user.email \"robot@dpp.dev\""); system("git config --global user.name \"Docs Deployment Bot\""); system("git config --global advice.detachedHead false"); /* Make drop down list of versions from the tags */ echo "Make version drop down select\n"; system("git fetch -av --tags"); $tags = explode("\n", shell_exec("git tag")); for ($n = 0; $n < count($tags); ++$n) { $tags[$n] = preg_replace('/^v/', '', $tags[$n]); } natsort($tags); $tags = array_reverse($tags); $opts = ""; foreach ($tags as $tag) { if ($tag != '') { $opts .= ""; } } $taglist = ''; foreach ($tags as $tag) { if ($tag != '') { $tag2 = str_replace("v", "", $tag); $taglist .= "D++ Library version $tag"; } } $template = file_get_contents("/home/runner/work/DPP/DPP/docpages/header.template.html"); $header = str_replace("##VERSION_OPTIONS##", $opts, $template); $footer = file_get_contents("/home/runner/work/DPP/DPP/docpages/footer.template.html"); $footer = str_replace("###PREV###", $taglist, $footer); file_put_contents("/home/runner/work/DPP/DPP/docpages/header.html", $header); file_put_contents("/home/runner/work/DPP/DPP/docpages/footer.html", $footer); echo "Generate `master` docs\n"; chdir(".."); shell_exec("/usr/local/bin/doxygen >/dev/null"); chdir("docs"); /* Insert giscus inside actual doc content */ system('perl -p -i -e \'s/(<.div><.-- contents -->)/$1