I want to automate the deployment of repo_root to a GCP Ubuntu server and ensure dependencies are managed efficiently using uv. The goal is to create a pipeline that:
Deploys the repo to the root directory on the Ubuntu server.
Ensures uv is installed, and if not, installs it.
Syncs dependencies via uv sync from pyproject.toml.
Starts Uvicorn to serve the FastAPI app.
The deployment should be triggered every time changes are pushed to the main branch.
Tasks:
Stage 1: GitHub Actions Setup
[ ] Create a GitHub Action workflow that triggers on push to the main branch.
[ ] Add steps to:
Checkout the repository.
SSH into the Ubuntu server.
Stage 2: Install and Verify uv on Ubuntu
[ ] Create a startup script that will be added to repo_root (so the latest is deployed to the VM) to check if uv is installed.
If not installed, run:
curl -LsSf https://astral.sh/uv/install.sh | sh
If installed, proceed to the next step.
Stage 3: Sync Dependencies
[ ] Run uv sync on the Ubuntu server to install dependencies from pyproject.toml.
Stage 4: Start Uvicorn Server
[ ] Add a command to start Uvicorn and serve the FastAPI app:
uvicorn main:app --reload
Stage 5: Testing and Debugging
[ ] Test the workflow with a sample deployment.
[ ] Ensure uv is correctly installed and synced on the server.
[ ] Verify that Uvicorn starts and the FastAPI app is accessible.
Future Enhancements:
[ ] Add error handling for the uv installation process.
[ ] Add logging for deployment and server startup.
I want to automate the deployment of repo_root to a GCP Ubuntu server and ensure dependencies are managed efficiently using
uv
. The goal is to create a pipeline that:uv
is installed, and if not, installs it.uv sync
frompyproject.toml
.The deployment should be triggered every time changes are pushed to the
main
branch.Tasks:
Stage 1: GitHub Actions Setup
push
to themain
branch.Stage 2: Install and Verify
uv
on Ubuntuuv
is installed.Stage 3: Sync Dependencies
uv sync
on the Ubuntu server to install dependencies frompyproject.toml
.Stage 4: Start Uvicorn Server
Stage 5: Testing and Debugging
uv
is correctly installed and synced on the server.Future Enhancements:
uv
installation process.