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
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,7 @@ Beyond development tooling, projects generated with this template include the co
92
92
6. Simple Web UI with [Streamlit](https://streamlit.io/)
93
93
7. Configuration to run the CLI and API in a Docker container including setup for [Docker Compose](https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-docker-compose/)
94
94
8. Documentation including badges, setup instructions, contribution guide and security policy
95
+
9. Preparation to deploy API as serverless function to Vercel
95
96
96
97
Explore [here](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example) for what's generated out of the box.
You can host the API as a serverless function on Vercel
4
+
5
+
## Register at Vercel
6
+
7
+
[Sign-Up](https://vercel.com/signup) and create a "Hobby" account - it's free.
8
+
9
+
## Install Vercel CLI
10
+
11
+
```shell
12
+
pnpm i -g vercel
13
+
```
14
+
15
+
## Generate, link and deploy Vercel Distribution
16
+
17
+
```shell
18
+
make dist_vercel
19
+
vercel login
20
+
vercel link --cwd dist_vercel --project oe-python-template-example --yes
21
+
vercel deploy --cwd dist_vercel
22
+
```
23
+
24
+
Visit the [production deployment](https://oe-python-template-example.vercel.app/)
25
+
26
+
## Wire the CI/CD
27
+
28
+
1. Show organisation and project id by executing `cat dist_vercel/.vercel/project.json`
29
+
2.[Create secret](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/settings/secrets/actions/new) called `VERCEL_PROJECT_ID` with the value of `projectId` from step 1
30
+
3.[Create secret](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/settings/secrets/actions/new) called `VERCEL_ORG_ID` with the value of `orgId` from step 1
31
+
4. Goto [Vercel Account Settings](https://vercel.com/account/settings/tokens) and create a new token with project scope, copy the token to clipboard.
32
+
5.[Create secret](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/settings/secrets/actions/new) called `VERCEL_TOKEN` with the value of `projectId` from the previous command
33
+
34
+
That's it. The rest is automatic, deploy happening on build of main.
0 commit comments