create-disposabl-app 0.2.3 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
ADDED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# CI and deployment
|
|
2
|
+
|
|
3
|
+
The app runs GitHub Actions on Boat's 4-CPU runner. Install the
|
|
4
|
+
[Boat CI GitHub App](https://docs.boat.dev/ci) for the repository with
|
|
5
|
+
`boat ci connect` before pushing. This connects the installation to the current
|
|
6
|
+
Boat billing account. It does not require a personal GitHub token or a Boat API
|
|
7
|
+
key in the workflow.
|
|
8
|
+
|
|
9
|
+
Boat CI requires a paid Boat plan. Public repositories also require explicit
|
|
10
|
+
enablement in Boat and an allowlist of GitHub users. Fork pull requests use
|
|
11
|
+
`ubuntu-latest` and build without deployment secrets.
|
|
12
|
+
|
|
13
|
+
Keep these repository or organization secrets in GitHub Actions:
|
|
14
|
+
|
|
15
|
+
- `CONVEX_DEPLOY_KEY`: production deploy key.
|
|
16
|
+
- `CONVEX_DEPLOY_KEY_PREVIEW`: project preview deploy key.
|
|
17
|
+
|
|
18
|
+
Do not move them to Boat environments. Boat CI deliberately does not inherit
|
|
19
|
+
those environments. GitHub supplies the workflow's secrets and job token.
|
|
20
|
+
`actions/cache` continues to store the Turbo cache through GitHub Actions.
|
|
21
|
+
|
|
22
|
+
Same-repository pull requests deploy branch previews. Pushing to `main` deploys
|
|
23
|
+
production. Set the GitHub Actions repository variable `DISPOSABL_CI_RUNNER` to
|
|
24
|
+
`boat-small` for 2 CPUs, `boat` for 4 CPUs, or `ubuntu-latest` for GitHub's runner.
|
|
25
|
+
Without the variable, normal jobs use `boat`.
|
|
26
|
+
|
|
27
|
+
## Compare runners
|
|
28
|
+
|
|
29
|
+
Run **CI and deploy** manually on the same branch and commit for each of
|
|
30
|
+
`ubuntu-latest`, `boat-small`, and `boat`. The workflow must first exist on the
|
|
31
|
+
default branch. Keep the lockfile and inputs identical.
|
|
32
|
+
|
|
33
|
+
Use a new `cache_scope`, such as `comparison-20261101-a`, for the first round.
|
|
34
|
+
Each runner has a separate Turbo cache namespace. Repeat with the same scope
|
|
35
|
+
and commit to measure a warm cache. The scope controls Turbo caching, not any
|
|
36
|
+
provider's preinstalled tools or package download caches. Check cache restore
|
|
37
|
+
logs and Turbo's hit counts before labeling a result warm.
|
|
38
|
+
|
|
39
|
+
The default manual run installs, checks, tests, and builds without deployment
|
|
40
|
+
credentials. Enable `preview` to measure the full deployment path using the
|
|
41
|
+
preview key. Manual runs never deploy production. Each runner gets a separate
|
|
42
|
+
`ci-benchmark-<runner>` preview. Manual runs on the same runner serialize across
|
|
43
|
+
branches, so two branches cannot deploy to the same benchmark preview at once.
|
|
44
|
+
|
|
45
|
+
Record the workflow/run URL, commit, attempt, actual CPU/RAM details from
|
|
46
|
+
**Record machine**, cache state, and step timings. For each job, compute queue
|
|
47
|
+
time as `started_at - created_at` and runtime as `completed_at - started_at`
|
|
48
|
+
from GitHub's jobs API. Also record time from workflow creation to job creation
|
|
49
|
+
and workflow creation to job completion, so workflow scheduling delay is not
|
|
50
|
+
hidden. For reruns, use that attempt's start and jobs instead of the original
|
|
51
|
+
workflow creation time.
|
|
52
|
+
|
|
53
|
+
The deployment log prints `Web build seconds` separately from the combined
|
|
54
|
+
backend deployment, web build, and upload step. `boat ci job <job-id> --json`
|
|
55
|
+
provides Boat's own provisioning/wait/runtime measurements. Do not add its wait
|
|
56
|
+
time to GitHub's queue time: the intervals can overlap. Compare multiple cold
|
|
57
|
+
and warm rounds before choosing a default based on speed.
|
|
@@ -6,18 +6,37 @@ on:
|
|
|
6
6
|
types: [opened, synchronize, reopened]
|
|
7
7
|
push:
|
|
8
8
|
branches: [main]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
inputs:
|
|
11
|
+
runner:
|
|
12
|
+
description: Machine to compare
|
|
13
|
+
type: choice
|
|
14
|
+
options: [ubuntu-latest, boat-small, boat]
|
|
15
|
+
default: boat
|
|
16
|
+
preview:
|
|
17
|
+
description: Deploy an isolated Convex preview, including the web build
|
|
18
|
+
type: boolean
|
|
19
|
+
default: false
|
|
20
|
+
cache_scope:
|
|
21
|
+
description: Use a new value for a cold run; reuse it for warm runs
|
|
22
|
+
type: string
|
|
23
|
+
default: benchmark-v1
|
|
9
24
|
|
|
10
25
|
permissions:
|
|
11
26
|
contents: read
|
|
12
27
|
|
|
13
28
|
concurrency:
|
|
14
|
-
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
|
|
29
|
+
group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && 'manual' || github.head_ref || github.ref_name }}-${{ inputs.runner || 'default' }}
|
|
15
30
|
cancel-in-progress: false
|
|
16
31
|
|
|
17
32
|
jobs:
|
|
18
33
|
pipeline:
|
|
19
|
-
if: github.event.deleted != true
|
|
20
|
-
|
|
34
|
+
if: github.event.deleted != true
|
|
35
|
+
# Install the Boat CI GitHub App first. Fork PRs use GitHub-hosted runners.
|
|
36
|
+
# DISPOSABL_CI_RUNNER can select boat-small or ubuntu-latest for normal runs.
|
|
37
|
+
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || inputs.runner || vars.DISPOSABL_CI_RUNNER || 'boat' }}
|
|
38
|
+
env:
|
|
39
|
+
CI_RUNNER: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || inputs.runner || vars.DISPOSABL_CI_RUNNER || 'boat' }}
|
|
21
40
|
timeout-minutes: 30
|
|
22
41
|
steps:
|
|
23
42
|
- name: Check out repository
|
|
@@ -25,6 +44,13 @@ jobs:
|
|
|
25
44
|
with:
|
|
26
45
|
persist-credentials: false
|
|
27
46
|
|
|
47
|
+
- name: Record machine
|
|
48
|
+
run: |
|
|
49
|
+
printf 'CPUs: %s\n' "$(nproc)"
|
|
50
|
+
lscpu
|
|
51
|
+
free -h
|
|
52
|
+
cat /etc/os-release
|
|
53
|
+
|
|
28
54
|
- name: Install Node.js
|
|
29
55
|
uses: actions/setup-node@v6
|
|
30
56
|
with:
|
|
@@ -40,9 +66,9 @@ jobs:
|
|
|
40
66
|
uses: actions/cache@v4
|
|
41
67
|
with:
|
|
42
68
|
path: .turbo/cache
|
|
43
|
-
key: turbo-${{ runner.os }}-${{ runner.arch }}-node24-bun1.4.4-${{ github.sha }}
|
|
69
|
+
key: turbo-${{ inputs.cache_scope || 'ci' }}-${{ env.CI_RUNNER }}-${{ runner.os }}-${{ runner.arch }}-node24-bun1.4.4-${{ github.sha }}
|
|
44
70
|
restore-keys: |
|
|
45
|
-
turbo-${{ runner.os }}-${{ runner.arch }}-node24-bun1.4.4-
|
|
71
|
+
turbo-${{ inputs.cache_scope || 'ci' }}-${{ env.CI_RUNNER }}-${{ runner.os }}-${{ runner.arch }}-node24-bun1.4.4-
|
|
46
72
|
|
|
47
73
|
- name: Install dependencies
|
|
48
74
|
run: bun install --frozen-lockfile
|
|
@@ -62,7 +88,7 @@ jobs:
|
|
|
62
88
|
|
|
63
89
|
- name: Build
|
|
64
90
|
# Trusted branches build once below, with their actual deployment URLs.
|
|
65
|
-
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
|
91
|
+
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || (github.event_name == 'workflow_dispatch' && !inputs.preview)
|
|
66
92
|
env:
|
|
67
93
|
VITE_CONVEX_URL: https://ci.invalid
|
|
68
94
|
VITE_CONVEX_SITE_URL: https://ci.invalid
|
|
@@ -79,24 +105,29 @@ jobs:
|
|
|
79
105
|
--cmd-url-env-var-name VITE_CONVEX_URL \
|
|
80
106
|
--cmd '
|
|
81
107
|
bun x --no-install --package @convex-dev/auth auth --keys-only --prod &&
|
|
108
|
+
build_started=$(date +%s) &&
|
|
82
109
|
VITE_CONVEX_SITE_URL="$CONVEX_SITE_URL" bun run --cwd ../.. build &&
|
|
110
|
+
echo "Web build seconds: $(($(date +%s) - build_started))" &&
|
|
83
111
|
echo "url=$CONVEX_SITE_URL" >> "$GITHUB_OUTPUT"
|
|
84
112
|
'
|
|
85
113
|
bun x --no-install static-hosting upload --prod --no-spa --dist ../../apps/web/dist/client
|
|
86
114
|
|
|
87
115
|
- name: Deploy preview
|
|
88
116
|
id: preview
|
|
89
|
-
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
|
117
|
+
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'workflow_dispatch' && inputs.preview)
|
|
90
118
|
working-directory: packages/backend
|
|
91
119
|
env:
|
|
92
120
|
CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY_PREVIEW }}
|
|
93
|
-
|
|
121
|
+
# Each benchmark runner gets its own preview to avoid concurrent writes.
|
|
122
|
+
PREVIEW_NAME: ${{ github.head_ref || format('ci-benchmark-{0}', inputs.runner) }}
|
|
94
123
|
run: |
|
|
95
124
|
bun x --no-install convex deploy --yes --preview-name "$PREVIEW_NAME" \
|
|
96
125
|
--cmd-url-env-var-name VITE_CONVEX_URL \
|
|
97
126
|
--cmd '
|
|
98
127
|
bun x --no-install --package @convex-dev/auth auth --keys-only --preview-name "$PREVIEW_NAME" &&
|
|
128
|
+
build_started=$(date +%s) &&
|
|
99
129
|
VITE_CONVEX_SITE_URL="$CONVEX_SITE_URL" bun run --cwd ../.. build &&
|
|
130
|
+
echo "Web build seconds: $(($(date +%s) - build_started))" &&
|
|
100
131
|
echo "url=$CONVEX_SITE_URL" >> "$GITHUB_OUTPUT"
|
|
101
132
|
'
|
|
102
133
|
bun x --no-install static-hosting upload --preview-name "$PREVIEW_NAME" --no-spa --dist ../../apps/web/dist/client
|