From 4190a5d2e540b190e7990ac8fd8833ac9d99e4d6 Mon Sep 17 00:00:00 2001 From: Damon <110209956+ProtoFaze@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:07:16 +0800 Subject: [PATCH] Create Deploy_modal_ollama.yml add a CI/CD on push workflow for modal --- .github/workflows/Deploy_modal_ollama.yml | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/Deploy_modal_ollama.yml diff --git a/.github/workflows/Deploy_modal_ollama.yml b/.github/workflows/Deploy_modal_ollama.yml new file mode 100644 index 0000000..7b0a052 --- /dev/null +++ b/.github/workflows/Deploy_modal_ollama.yml @@ -0,0 +1,34 @@ +name: CI/CD + +on: + push: + branches: + - main + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + env: + MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }} + MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }} + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: "3.12.7" + + - name: Install Modal + run: | + python -m pip install --upgrade pip + pip install modal + + - name: Deploy job + run: | + cd ollama_backend + modal run ollama_backend.py + modal deploy ollama_backend.py