|
| 1 | +--- |
| 2 | +sidebar_position: 99 |
| 3 | +title: Deployment |
| 4 | +--- |
| 5 | + |
| 6 | +# Deployment Process |
| 7 | + |
| 8 | +This documentation site is automatically deployed to Google Cloud Run whenever changes are pushed to the main branch. This document outlines the deployment process and how to make changes to it. |
| 9 | + |
| 10 | +## Automated Deployment |
| 11 | + |
| 12 | +The documentation site uses GitHub Actions for continuous integration and deployment (CI/CD): |
| 13 | + |
| 14 | +1. When changes are pushed to the `main` branch, a GitHub workflow is triggered |
| 15 | +2. The workflow builds the Docusaurus site and packages it in a Docker container |
| 16 | +3. The container is pushed to Google Container Registry |
| 17 | +4. The container is deployed to Google Cloud Run |
| 18 | +5. The site is accessible at the Cloud Run URL (with custom domain mapping) |
| 19 | + |
| 20 | +## Deployment Infrastructure |
| 21 | + |
| 22 | +The deployment infrastructure consists of: |
| 23 | + |
| 24 | +- **Docker Container**: The site is packaged in a Docker container for consistent deployment |
| 25 | +- **Google Container Registry**: Stores the Docker images |
| 26 | +- **Google Cloud Run**: Hosts the documentation site |
| 27 | +- **GitHub Actions**: Automates the build and deployment process |
| 28 | + |
| 29 | +## Local Development and Testing |
| 30 | + |
| 31 | +To test the deployment locally: |
| 32 | + |
| 33 | +1. Build the Docker image: |
| 34 | + ```bash |
| 35 | + docker build -t mycoder-docs . |
| 36 | + ``` |
| 37 | + |
| 38 | +2. Run the container locally: |
| 39 | + ```bash |
| 40 | + docker run -p 8080:8080 mycoder-docs |
| 41 | + ``` |
| 42 | + |
| 43 | +3. Access the site at http://localhost:8080 |
| 44 | + |
| 45 | +## Manual Deployment |
| 46 | + |
| 47 | +While the deployment is automated, you can also trigger a manual deployment: |
| 48 | + |
| 49 | +1. Go to the GitHub repository |
| 50 | +2. Navigate to Actions → Deploy Documentation to Cloud Run workflow |
| 51 | +3. Click "Run workflow" and select the branch to deploy |
| 52 | + |
| 53 | +## Troubleshooting |
| 54 | + |
| 55 | +If you encounter issues with the deployment: |
| 56 | + |
| 57 | +1. Check the GitHub Actions logs for any errors |
| 58 | +2. Verify that the Docker container builds successfully locally |
| 59 | +3. Ensure the Google Cloud service account has the necessary permissions |
| 60 | +4. Check the Cloud Run logs for runtime errors |
| 61 | + |
| 62 | +## Modifying the Deployment Process |
| 63 | + |
| 64 | +To modify the deployment process: |
| 65 | + |
| 66 | +1. Update the `.github/workflows/deploy-docs.yml` file for changes to the CI/CD pipeline |
| 67 | +2. Update the `Dockerfile` for changes to the container configuration |
| 68 | +3. Test changes locally before pushing to the repository |
0 commit comments