aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-03-31 15:40:49 -0700
committerDhravya <[email protected]>2024-03-31 15:40:49 -0700
commit4e1cc8a52fc457f05e908eeae30b309461d8072b (patch)
tree5f09b86796b9b9012dddf32dd44ef7e65055c9a9 /.github/workflows
parent(ci): conditionally build and deploy (diff)
downloadsupermemory-4e1cc8a52fc457f05e908eeae30b309461d8072b.tar.xz
supermemory-4e1cc8a52fc457f05e908eeae30b309461d8072b.zip
added workflow to auto deploy workers
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml18
1 files changed, 18 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 653bb11e..ab8ae98f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -50,9 +50,27 @@ jobs:
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: apps/web/.vercel/output/static
branch: main
+
+ deploy-cf-worker:
+ if: contains(github.event.head_commit.modified, 'apps/cf-ai-backend/') || contains(github.event.head_commit.added, 'apps/cf-ai-backend/') || contains(github.event.head_commit.removed, 'apps/cf-ai-backend/')
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repo
+ uses: actions/checkout@v3
+
+ - name: Deploy to Cloudflare Workers
+ uses: cloudflare/[email protected]
+ with:
+ apiToken: ${{ secrets.CF_API_TOKEN }}
+ script: wrangler publish
+ working-directory: apps/cf-ai-backend
+ env:
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
+ SECURITY_KEY: ${{ secrets.BACKEND_SECURITY_KEY }} \ No newline at end of file