From 0ff27a5dbf290b790bac7b709093ce16cac0f0d2 Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:16:43 +0100 Subject: [PATCH] feat: Add deployment workflow and script This commit introduces a new GitHub Actions workflow for deployment. It triggers on push to the main branch and on workflow dispatch. The workflow uses the setup-bun action with the latest bun version, installs dependencies with bun i --frozen-lockfile, and runs the newly added "deploy" script from package.json. The "deploy" script has also been added as a dependency in turbo.json. A CLOUDFLARE_API_TOKEN environment variable is used during deployment, which is fetched from GitHub secrets. --- .github/workflows/deploy.yaml | 21 +++++++++++++++++++++ package.json | 3 ++- turbo.json | 3 +++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 00000000..cf894842 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,21 @@ +name: Deploy + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + - run: bun i --frozen-lockfile + - run: bun run deploy + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} diff --git a/package.json b/package.json index 2495a484..9f023cc7 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "scripts": { "build": "turbo build", "lint": "turbo lint", - "test": "turbo test" + "test": "turbo test", + "deploy": "turbo deploy" }, "workspaces": [ "examples/*", diff --git a/turbo.json b/turbo.json index 65080053..5b271084 100644 --- a/turbo.json +++ b/turbo.json @@ -16,6 +16,9 @@ "dev": { "persistent": true, "cache": false + }, + "deploy": { + "dependsOn": ["^deploy"] } } }