You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+86-10Lines changed: 86 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,7 @@
2
2
3
3
A minimal FastAPI "Hello, World!" service, managed with [uv](https://docs.astral.sh/uv/).
4
4
5
-
This `main` branch contains only the app and local dev setup. Deployment is demonstrated on two separate branches:
6
-
7
-
-**[`deploy-script`](../../tree/deploy-script)** — deploy with a local `gcloud` script ([deploy.sh](deploy.sh)).
8
-
-**[`deploy-github`](../../tree/deploy-github)** — deploy from GitHub via a GitHub Actions workflow.
5
+
**Branch: `deploy-github`** — deploys to Google Cloud Run automatically when you push to this branch, using a GitHub Actions workflow with Workload Identity Federation for keyless auth.
9
6
10
7
## Stack
11
8
@@ -23,7 +20,9 @@ This `main` branch contains only the app and local dev setup. Deployment is demo
23
20
├── uv.lock # locked dependency graph
24
21
├── .python-version # pins Python 3.13 for uv
25
22
├── Dockerfile # uv-based container build
26
-
└── .dockerignore
23
+
├── .dockerignore
24
+
└── .github/workflows/
25
+
└── deploy.yml # GitHub Actions → Cloud Run
27
26
```
28
27
29
28
## Endpoints
@@ -73,12 +72,89 @@ docker run --rm -p 8080:8080 fastapi-basic
73
72
74
73
The image installs deps with `uv sync --frozen --no-dev` against `uv.lock`, so the container matches local exactly.
75
74
76
-
## Deploying
75
+
## Deploy to Google Cloud Run (via GitHub Actions)
76
+
77
+
A push to the `deploy-github` branch triggers [.github/workflows/deploy.yml](.github/workflows/deploy.yml), which builds and deploys the service with `gcloud run deploy --source .`.
77
78
78
-
Check out one of the deploy branches:
79
+
### One-time GCP setup
80
+
81
+
You only need to do this once per project. Replace `PROJECT_ID` and `GITHUB_REPO` (e.g. `your-org/your-repo`) with your values.
79
82
80
83
```bash
81
-
git checkout deploy-script # local gcloud-based deploy
0 commit comments