From 2f7ae79c70781ae943fecdfb9a020afd4d48e0d4 Mon Sep 17 00:00:00 2001 From: Jonah Lawrence Date: Sun, 5 Dec 2021 21:37:10 -0700 Subject: [PATCH] docs: Added documentation to readme --- README.md | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 104 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18eb63d..240734e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,104 @@ -# doxygen-github-pages-action -GitHub Action for deploying Doxygen documentation to a GitHub pages branch +# Doxygen GitHub Pages Deploy Action + +GitHub Action for making and deploying Doxygen documentation to a GitHub pages branch + +## Basic Usage + +To deploy docs on every push to the `main` branch, create a new file in the `.github/workflows/` directory called `doxygen-gh-pages.yml` with the following contents: + +```yml +name: Doxygen GitHub Pages Deploy Action + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: DenverCoder1/doxygen-github-pages-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} +``` + +## Options + +- `github_token` (required): GitHub token for pushing to repo. See the [docs](https://git.io/passing-token) for more info. +- `branch` (optional): Branch to deploy to. Defaults to `gh-pages`. +- `folder` (optional): Folder where the docs are built. Defaults to `docs/html`. + +## Advanced Usage + +Here is an example of a `.github/workflows/doxygen-gh-pages.yml` file with more advanced configuration: + +```yml +name: Doxygen GitHub Pages Deploy Action + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: DenverCoder1/doxygen-github-pages-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages + folder: docs/html +``` + +## About this Action + +This action is a composite action containing the following steps: + +### 1. Checkout repository + +The [actions/checkout](https://github.com/actions/checkout) step is used to checkout the repository with any submodules. + +### 2. Install Doxygen + +Doxygen is installed by running the following command: + +```bash +sudo apt-get install doxygen -y +``` + +### 3. Generate Doxygen Documentation + +Doxygen documentation is generated by running the following command: + +```bash +doxygen +``` + +### 4. Create .nojekyll + +Creating a .nojekyll file ensures pages with underscores work on GitHub Pages. + +Set the `folder` input option to change `docs/html` to a different folder. + +```bash +touch docs/html/.nojekyll +``` + +### 5. Deploy to GitHub Pages + +The [JamesIves/github-pages-deploy-action](https://github.com/JamesIves/github-pages-deploy-action) action is used to deploy the documentation to GitHub Pages. + +The `folder` option determines which folder to deploy. By default, it is `docs/html`. + +The `branch` option determines which branch to deploy to. By default, it is `gh-pages`. + +## License + +This work is under an [MIT license](LICENSE) + +## Support + +If you like this project, give it a ⭐ and share it with friends!