-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
54 lines (51 loc) · 1.71 KB
/
Copy pathdeploy.yml
File metadata and controls
54 lines (51 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Deploy
on:
push:
branches:
- master
paths-ignore:
- release-notes.md
workflow_dispatch:
permissions:
contents: read
jobs:
deploy:
# Do not deploy the template repository, only projects created from it
if: github.repository != 'fastapi/full-stack-fastapi-template'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.12
- name: Install frontend dependencies
run: bun ci
- name: Build frontend
run: bun run --filter frontend build
env:
# Override frontend/.env so the deployed frontend uses the same origin as the API
VITE_API_URL: ""
- name: Set up uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: "latest-known"
- name: Prepare database
run: uv run bash scripts/prestart.sh
working-directory: backend
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PROJECT_NAME: ${{ vars.PROJECT_NAME }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
FIRST_SUPERUSER: ${{ vars.FIRST_SUPERUSER }}
FIRST_SUPERUSER_PASSWORD: ${{ secrets.FIRST_SUPERUSER_PASSWORD }}
- name: Deploy to FastAPI Cloud
run: uv run fastapi deploy
env:
FASTAPI_CLOUD_TOKEN: ${{ secrets.FASTAPI_CLOUD_TOKEN }}
FASTAPI_CLOUD_APP_ID: ${{ secrets.FASTAPI_CLOUD_APP_ID }}