In the process of developing AI tools independently, the author gradually practiced an efficient software project continuous integration and continuous deployment (CI/CD) process. With Git, GitHub, and Vercel at its core, this process automates the entire link from code submission to production launch. This article introduces specific technical ideas and practical experience.
1. Background: Solve the deployment pain points in software development
In the process of developing AI tools, after completing functions and testing locally, traditional deployment methods require repeated tedious operations such as packaging, uploading servers, and service restarts. The whole process has many steps, is time-consuming, and is prone to human error.
At present, by adopting the automated process of Git+GitHub+Vercel, the process from code submission to deployment and launch is fixed, significantly improving iteration efficiency. This automation mechanism is particularly critical for AI projects, allowing for quick verification of model optimization and timely response to user feedback.
2. Technical solution: Build an automated workflow
- As the core tool of local version control, Git is mainly responsible for recording code change history, managing development branches, and supporting version rollback.
- GitHub, as a cloud-based code hosting platform, provides remote repository storage, collaborative review, and webhook triggering capabilities.
- Vercel focuses on serverless deployments, with the ability to automate project building, manage environment variables, and accelerate access through a global CDN. The value of the platform lies in the direct translation of source code into services available online, eliminating the need to manually configure the server environment.
The logic of these three tools working together is clear: when a developer uses Git to push local changes to the GitHub repository, GitHub immediately notifies Vercel via a webhook; Vercel automatically pulls the latest code, executes build scripts, and deploys them to production, enabling true commit-and-release.
3. Operation practice: configuration and execution details
When developing AI tools independently, Git’s native operation process is as follows:
- First, run gitinit to initialize the repository; Then create a standalone function branch gitcheckout-bfeat/ocr-module;
- After completing the code changes, stage all changes through gitadd.;
- Finally, use gitcommit-m “feat: Supplementary change function description” to commit and describe the changes, and then push them to the remote repository with gitpushoriginfeat/ocr-module.
The key to this process is to follow the principle of “atomic commits” (each commit completes only one independent feature or fix), such as complex features can be split into multiple logical step commits and prefixes such as feat/fix/docs are used to accurately describe the nature of the change, which effectively reduces the risk of subsequent merge conflicts.
# Local operation command schematic
git init # initialize the repository
git checkout -b feat/ocr-module # to create a feature branch
# Develop code…
git add . # Stage all changes
git commit -m “feat: Implement OCR text recognition module” # Use English quotation marks and prefix specifications
git push origin feat/ocr-module # to the remote branch
The configuration of GitHub repositories requires special attention on two levels:
- When creating a repository, the public repository is suitable for open source projects and can use CI/CD for free. Private repositories provide better protection for commercial code and can be created and used without a GitHub Pro subscription, although subscriptions may be considered for more advanced features.
- In terms of security configuration, branch protection rules should be enabled, requiring all code merged into the main branch to pass automated testing, and for core AI model files, a dedicated code reviewer can be set up to ensure code quality and security.
The following describes the deployment process using Vercel.
First, the project is imported and initialized. After logging in to the Vercel console (https://vercel.com/), click “Import Project”, authorize the association of your GitHub account, and select the target repository (e.g., “my-ai-project”). Vercel automatically identifies frameworks in the repository (such as Node.js, Python, Next.js, etc.), eliminating the need to manually configure the build environment and simplifying the initialization process.
Then perform branch listening and build trigger configuration. Specify the trigger branch in the project “Settings → Git”, and it is recommended to select the “main” branch (the default main branch). Vercel will automatically trigger the build only when the code is pushed to the branch, avoiding invalid builds of the development branch and improving deployment efficiency.
Finally, customize the domain name with HTTPS configuration. Click “Add Domain” in “Settings → Domains” and enter a custom domain name (e.g., “ai.example.com”).
Note that you need to purchase a domain name from a domain name service provider (such as Alibaba Cloud, Tencent Cloud, etc.) in advance, and then add DNS resolution records based on the CNAME records generated by Vercel (such as “ai.example.com → cname.vercel-dns.com”) in the domain name service provider’s backend.
After waiting for the DNS to take effect (about 10-30 minutes), Vercel will automatically apply for a Let’s Encrypt free SSL certificate to achieve HTTPS encrypted access and ensure website security.
For AI projects, it is especially important to properly manage environment variables in the Vercel console and to independently configure sensitive information such as OPENAI_API_KEY in development, preview, and production environments. For example, the author uses the official DeepSeek API in the project, and the corresponding API-KEY is sensitive information that needs to be managed in the Vercel environment variable.
The core value of Git+GitHub+Vercel’s automation solution is to minimize deployment complexity. AI developers do not need to pay attention to server configuration, but focus on model optimization and business logic development. At the same time, it ensures the security of sensitive commercial information through strict environmental isolation and security configuration. Whether it’s the rapid verification of open-source projects or the stable deployment of commercial AI tools, this solution can efficiently meet the needs and realize the “code is deployment” development concept.