From 3a8e2d7e883a160b802a83db5d0840c610dd7968 Mon Sep 17 00:00:00 2001 From: sl kim Date: Fri, 23 Aug 2024 19:34:31 +0900 Subject: [PATCH] =?UTF-8?q?GitHub=20Actions=EB=A1=9C=20Vercel=EC=97=90=20?= =?UTF-8?q?=EB=B0=B0=ED=8F=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yaml | 35 +++++++++++++++++++++++++++++++++++ vercel.json | 23 +++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/deploy.yaml create mode 100644 vercel.json diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..25fa53b --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,35 @@ +name: Deploy + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install Vercel CLI + run: bun install -g vercel@latest + + - name: Upgrade pip + run: python -m pip install --upgrade pip + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Download database + run: wget -O db.sqlite3 ${{ secrets.DB_FILE_URL }} + + - name: Deploy to Vercel + run: vercel --token ${{ secrets.VERCEL_TOKEN }} --prod diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..cfa7dec --- /dev/null +++ b/vercel.json @@ -0,0 +1,23 @@ +{ + "version": 2, + "builds": [ + { + "src": "anijung/wsgi.py", + "use": "@vercel/python" + }, + { + "src": "/static/**", + "use": "@vercel/static" + } + ], + "routes": [ + { + "src": "/static/(.*)", + "dest": "/staticfiles/$1" + }, + { + "src": "/(.*)", + "dest": "anijung/wsgi.py" + } + ] +}