Skip to content

Commit

Permalink
feat: Add deployment workflow and script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ryoppippi committed Jun 6, 2024
1 parent 891cabc commit 0ff27a5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"scripts": {
"build": "turbo build",
"lint": "turbo lint",
"test": "turbo test"
"test": "turbo test",
"deploy": "turbo deploy"
},
"workspaces": [
"examples/*",
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"dev": {
"persistent": true,
"cache": false
},
"deploy": {
"dependsOn": ["^deploy"]
}
}
}

0 comments on commit 0ff27a5

Please sign in to comment.