Documentation Index
Fetch the complete documentation index at: https://docs.riad.com.bd/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
FumaDoc is a powerful tool for generating documentation from your codebase. By deploying FumaDoc in a Docker container and integrating it with GitHub Actions, you can automate the process of documentation generation every time you push changes to your repository. This guide will walk you through the steps to set up FumaDoc in Docker and connect it to GitHub Actions.Prerequisites
Before you begin, ensure you have the following prerequisites:- Docker installed on your local machine or server.
- A GitHub repository where you want to generate documentation.
- Basic knowledge of Docker and GitHub Actions.
Project Overview
In this guide, we will cover the following steps:- Setting up a Docker container for FumaDoc.
- Configuring GitHub Actions to trigger FumaDoc documentation generation.
- Testing the setup to ensure everything works as expected.
Project Structure
Here is an overview of the project structure we will be working with:Step 1: Setting Up Docker for FumaDoc
First, we need to create a Dockerfile to set up the FumaDoc environment. Create a file namedDockerfile in the root of your project with the following content:
Step 2: Building and Running the Docker Container
To build and run the Docker container, use the following commands in your terminal:Step 3: run docker compose
Create adocker-compose.yml file in the root of your project with the following content:
Step 4: Configuring GitHub Actions
Next, we will set up a GitHub Actions workflow to automate the documentation generation process. Create a file nameddeploy-fumadocs.yml in the .github/workflows/ directory of your repository with the following content:
main branch and will build and push the Docker image to GitHub Container Registry, then deploy it to your server via SSH.
Step 5: Secrets required for GitHub Actions
To securely connect to your server and GitHub Container Registry, you need to add the following secrets to your GitHub repository:GHCR_TOKEN: A personal access token withwrite:packagesscope for GitHub Container Registry.SERVER_HOST: The IP address or hostname of your server.SERVER_USER: The SSH username for your server.SERVER_SSH_KEY: The private SSH key for accessing your server.
Step 6: Testing the Setup
After setting up the Docker container and GitHub Actions workflow, push a change to your repository to trigger the workflow. Monitor the Actions tab in your GitHub repository to ensure the workflow runs successfully and deploys FumaDoc to your server.Step 7: Accessing FumaDoc
Once the deployment is complete, you can access FumaDoc by navigating tohttp://<your-server-ip>:3000 in your web browser.
Step 8: Adding pages to FumaDoc
To add new documentation pages to FumaDoc, simply create markdown files in thecontent/ directory of your project. FumaDoc will automatically generate documentation based on the content of these files.
Conclusion
By following this guide, you have successfully deployed FumaDoc in a Docker container and connected it to GitHub Actions for automated documentation generation. This setup will help streamline your documentation process and ensure that your documentation is always up-to-date with the latest changes in your codebase. Happy documenting!Additional Resources
Troubleshooting
If you encounter any issues during the setup process, consider the following troubleshooting tips:- Ensure that Docker is properly installed and running on your machine or server.
- Verify that your GitHub Actions workflow has the correct permissions and secrets configured.
- Check the logs of your GitHub Actions workflow for any error messages that can help identify the issue.
- Make sure that your server is accessible via SSH and that the provided credentials are correct.