Github The Besttt
Github The Besttt
Github The Besttt
cd /path/to/repoName
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.md
git add .
git commit -a -m "First pages commit"
git push origin gh-pages
One more thing is needed for the above page to be hosted. In the gh-pages repo, add or edit
any existing index.md file. This is what the server will display. This is written in markdown
language. The following index.md file shows the doxygen, javadoc, and pdf files:
-----------------------------
# **Documentation**
----------------------------
___________________________
## **Version X.Y**
* [User's Guide PDF](https://jeffersonlab.github.io/repoName/docDir/users_guide/Users_Guide.pdf)
* [Javadoc for Java Library](https://jeffersonlab.github.io/repoName/docDir/javadoc/index.html)
* [Doxygen for C Library](https://jeffersonlab.github.io/repoName/docDir/doxygen/C/html/index.html)
* [Doxygen for C++ Library](https://jeffersonlab.github.io/repoName/docDir/doxygen/CC/html/index.html)
# Automatic generation of doxygen and javadoc files for C, C++, and Java code
# in myBranch which will be copied and checked into the gh-pages branch.
name: Documentation generation CI
on:
push:
branches: [ myBranch ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# checkout myBranch
- uses: actions/checkout@v2
copy:
runs-on: ubuntu-latest
needs: build
steps:
# checkout the gh-pages branch
- uses: actions/checkout@v2
with:
ref: gh-pages
This action has 2 jobs defined. The first, build, will copy your branch, generate the docs from it,
and upload the doc directory to storage. The second, copy, copies the gh-pages branch,
downloads the stored directory, then adds, commits, & pushes the changes to the gh_pages
branch. The second job does not start until the first has been completed. Notice that not only
the generated docs, but also existing pdf or other non-generated files can be added to the gh-
pages branch – as long as they’re among the files copied along with the generated files.
Name this file something like myDocGenerator.yml and place this into your repository’s
.github/workflows
directory of the main branch. Of course, you’ll need to modify it to suit you such as the paths to
the Doxyfiles & the java code, the java version to use, and the name of the directory to store
things on the gh-pages branch.
This file was setup to use ant to generate the javadoc. If you’re using another method, replace
the “Javadoc Action” with one that works for you. There are many available to do the job
without having to create one from scratch.
You’ll also, most likely, need to modify your .gitignore file by adding the line:
!.github/
When you’ve pushed this file to the repository, it will start the github action. On the
repository’s github web site,
It will show the progress and success (or failure) of your action. Enjoy the iterative process in
getting it to work.
If the action is successful, look at the gh-pages branch and see if the doc files are listed there.
Modify your index.md file to point to all the proper doc files. Finally, point your browser to:
https://jeffersonlab.github.io/<repoName>
to see if it’s working. Consider modifying your main branch’s README.md file to contain a link
to this.