chore: remove Orbiter options
d58372e3
5 file(s) · +2 −336
| 1 | - | # Orbiter |
|
| 2 | - | ||
| 3 | - | import { Button } from 'vocs/components' |
|
| 4 | - | ||
| 5 | - | <img src="https://docs.orbiter.host/light_logo.svg" alt="orbiter" className="mx-auto" /> |
|
| 6 | - | ||
| 7 | - | Much like the [inspiration](/why-bhvr) behind bhvr, [Orbiter](https://orbiter.host) is a site hosting platform built on the principles that the web should be open and without walled gardens. It features many of the things every dev wants: |
|
| 8 | - | ||
| 9 | - | - Simple CLI for local builds and deployments |
|
| 10 | - | - Custom Domains |
|
| 11 | - | - Analytics |
|
| 12 | - | - Version Control for easy rollbacks |
|
| 13 | - | - GitHub actions for automated deployments |
|
| 14 | - | - Serverless Functions |
|
| 15 | - | ||
| 16 | - | In this guide we'll show you how to deploy your [`client`](/packages/client) to Orbiter in no time at all. |
|
| 17 | - | ||
| 18 | - | ## Client Deployment |
|
| 19 | - | ||
| 20 | - | ::::note |
|
| 21 | - | Orbiter is currently only for client side rendered sites (aka static sites) |
|
| 22 | - | :::: |
|
| 23 | - | ||
| 24 | - | ::::steps |
|
| 25 | - | ||
| 26 | - | ### Setup Orbiter Account |
|
| 27 | - | ||
| 28 | - | Visit [app.orbiter.host](https://app.orbiter.host) to create a free account and make an API key on the [App Dashboard](https://app.orbiter.host) or on the [Keys Page](https://app.orbiter.host/api-keys) |
|
| 29 | - | ||
| 30 | - | ### Install the Orbiter CLI and Authorize |
|
| 31 | - | ||
| 32 | - | ```bash [terminal] |
|
| 33 | - | bun add -g orbiter-cli |
|
| 34 | - | ``` |
|
| 35 | - | ||
| 36 | - | ```bash [terminal] |
|
| 37 | - | orbiter auth |
|
| 38 | - | ``` |
|
| 39 | - | ||
| 40 | - | ### Deploy `client` |
|
| 41 | - | ||
| 42 | - | Move into the `client` package and run the `deploy` command |
|
| 43 | - | ||
| 44 | - | ```bash [terminal] |
|
| 45 | - | cd client |
|
| 46 | - | ||
| 47 | - | orbiter deploy |
|
| 48 | - | ``` |
|
| 49 | - | ||
| 50 | - | :::: |
|
| 51 | - | ||
| 52 | - | ## GitHub Actions |
|
| 53 | - | ||
| 54 | - | Orbiter also offers GitHub Actions which can be used to deployment automatically. |
|
| 55 | - | ||
| 56 | - | If you haven't already, [create a free account](https://app.orbiter.host) and create your first site. Then you will need the following information: |
|
| 57 | - | ||
| 58 | - | - Project Name: This would be the name you chose when you made the site. For example, the site `mysite.orbiter.website` the name would be `mysite` |
|
| 59 | - | - Build Directory: The name your build directory, e.g. `dist`, `out`, `public`, etc |
|
| 60 | - | - Orbiter API Key: This can be created on the [API Keys Page](https://app.orbiter.host/api-keys) of the Orbiter App |
|
| 61 | - | - Node Version (Optional): Define the version of Node you want to use, will default to v20 |
|
| 62 | - | - Build Command (Optional): Define the command used to build, default is `npm run build` |
|
| 63 | - | ||
| 64 | - | Once you have all of this info prepared make a new directory called `.github` in the root of your folder, then add a directory called `worflows` to it. Finally make a new file called `deploy.yaml`. |
|
| 65 | - | ||
| 66 | - | Alternatively run this in terminal: |
|
| 67 | - | ||
| 68 | - | ```bash |
|
| 69 | - | mkdir -p .github/workflows && touch .github/workflows/deploy.yaml |
|
| 70 | - | ``` |
|
| 71 | - | ||
| 72 | - | Paste in the following code into the `deploy.yaml` file with your config listed earlier |
|
| 73 | - | ||
| 74 | - | ```yaml |
|
| 75 | - | name: Deploy |
|
| 76 | - | on: |
|
| 77 | - | push: |
|
| 78 | - | branches: [main] |
|
| 79 | - | ||
| 80 | - | jobs: |
|
| 81 | - | deploy: |
|
| 82 | - | runs-on: ubuntu-latest |
|
| 83 | - | ||
| 84 | - | steps: |
|
| 85 | - | - uses: actions/checkout@v3 |
|
| 86 | - | ||
| 87 | - | - name: Deploy to Orbiter |
|
| 88 | - | uses: orbiterhost/orbiter-github-actions@v0.1.4 # Update with latest version |
|
| 89 | - | with: |
|
| 90 | - | project-name: "mysite" # Name of your project |
|
| 91 | - | build-dir: "./dist" # Name of the build output directory |
|
| 92 | - | api-key: ${{ secrets.ORBITER_API_KEY }} # Will use repository secret |
|
| 93 | - | # Optional inputs with their defaults |
|
| 94 | - | node-version: "20.x" # Optional, defaults to '20.x' |
|
| 95 | - | build-command: "npm run build" # Optional, defaults to 'npm run build' |
|
| 96 | - | ``` |
|
| 97 | - | ||
| 98 | - | Lastly you will need to add your Orbiter API Key as a Repository Secret. Navigate GitHub project Settings > Secrets and Variables > Actions. Click `New repository secret`, then use `ORBITER_API_KEY` as the name, and then paste the secret into the box below. |
|
| 99 | - | ||
| 100 | - | Then you're all set! On your next deployment you can check the `Actions` tab of the GitHub project to make sure it deployed successfully. |
|
| 101 | - | ||
| 102 | - | ## Further Reference |
|
| 103 | - | ||
| 104 | - | For more information about how to use Orbiter visit the official docs with the link below |
|
| 105 | - | ||
| 106 | - | <Button href="https://docs.orbiter.host">Orbiter Docs</Button> |
| 1 | - | # Orbiter |
|
| 2 | - | ||
| 3 | - | import { Button } from 'vocs/components' |
|
| 4 | - | ||
| 5 | - | <img src="https://docs.orbiter.host/light_logo.svg" alt="orbiter" className="mx-auto" /> |
|
| 6 | - | ||
| 7 | - | Much like the [inspiration](/why-bhvr) behind bhvr, [Orbiter](https://orbiter.host) is a site hosting platform built on the principles that the web should be open and without walled gardens. It features many of the things every dev wants: |
|
| 8 | - | ||
| 9 | - | - Simple CLI for local builds and deployments |
|
| 10 | - | - Custom Domains |
|
| 11 | - | - Analytics |
|
| 12 | - | - Version Control for easy rollbacks |
|
| 13 | - | - GitHub actions for automated deployments |
|
| 14 | - | - Serverless Functions |
|
| 15 | - | ||
| 16 | - | In this guide we'll show you how to deploy your [`server`](/packages/server) to Orbiter Functions. |
|
| 17 | - | ||
| 18 | - | ## Server Deployment |
|
| 19 | - | ||
| 20 | - | ::::note |
|
| 21 | - | Orbiter Functions are only available on paid plans. [Upgrade today!](https://app.orbiter.host/billing) |
|
| 22 | - | :::: |
|
| 23 | - | ||
| 24 | - | ### Quickstart |
|
| 25 | - | ||
| 26 | - | If you haven't already created your bhvr app you can quickly create one using the Orbiter CLI |
|
| 27 | - | ||
| 28 | - | ::::steps |
|
| 29 | - | ||
| 30 | - | #### Setup Orbiter Account |
|
| 31 | - | ||
| 32 | - | Visit [app.orbiter.host](https://app.orbiter.host) to create an account and make an API key on the [App Dashboard](https://app.orbiter.host) or on the [Keys Page](https://app.orbiter.host/api-keys). |
|
| 33 | - | ||
| 34 | - | #### Install the Orbiter CLI and Authorize |
|
| 35 | - | ||
| 36 | - | ```bash [terminal] |
|
| 37 | - | bun add -g orbiter-cli@latest |
|
| 38 | - | ``` |
|
| 39 | - | ||
| 40 | - | ```bash [terminal] |
|
| 41 | - | orbiter auth |
|
| 42 | - | ``` |
|
| 43 | - | ||
| 44 | - | #### Create a New bhvr Project |
|
| 45 | - | ||
| 46 | - | Orbiter includes a special version of bhvr that has everything you need to have a fullstack app |
|
| 47 | - | ||
| 48 | - | ```bash [terminal] |
|
| 49 | - | orbiter new --template bhvr |
|
| 50 | - | ``` |
|
| 51 | - | ||
| 52 | - | This will automatically install, build, and deploy the client and server packages of your bhvr project! |
|
| 53 | - | ||
| 54 | - | #### Deploy |
|
| 55 | - | ||
| 56 | - | Whenever you need to upload, simply run any of the `deploy` commands |
|
| 57 | - | ||
| 58 | - | ```bash [terminal] |
|
| 59 | - | bun run deploy:client |
|
| 60 | - | bun run deploy:server |
|
| 61 | - | bun run deploy # Deploys both client and server |
|
| 62 | - | ``` |
|
| 63 | - | ||
| 64 | - | :::: |
|
| 65 | - | ||
| 66 | - | ### Manual Setup |
|
| 67 | - | ||
| 68 | - | Follow this guide if you already have an existing bhvr project you want to deploy to Orbiter |
|
| 69 | - | ||
| 70 | - | ::::steps |
|
| 71 | - | ||
| 72 | - | #### Setup Orbiter Account |
|
| 73 | - | ||
| 74 | - | Visit [app.orbiter.host](https://app.orbiter.host) to create an account and make an API key on the [App Dashboard](https://app.orbiter.host) or on the [Keys Page](https://app.orbiter.host/api-keys). |
|
| 75 | - | ||
| 76 | - | #### Install the Orbiter CLI and Authorize |
|
| 77 | - | ||
| 78 | - | ```bash [terminal] |
|
| 79 | - | bun add -g orbiter-cli@latest |
|
| 80 | - | ``` |
|
| 81 | - | ||
| 82 | - | ```bash [terminal] |
|
| 83 | - | orbiter auth |
|
| 84 | - | ``` |
|
| 85 | - | ||
| 86 | - | #### Update Export Format |
|
| 87 | - | ||
| 88 | - | Update the code inside `server/src/index.ts` to use the export format required by Orbiter Functions: |
|
| 89 | - | ||
| 90 | - | ```typescript [server/src/index.ts] |
|
| 91 | - | import { Hono } from 'hono' |
|
| 92 | - | import { cors } from 'hono/cors' |
|
| 93 | - | import type { ApiResponse } from 'shared/dist' |
|
| 94 | - | ||
| 95 | - | const app = new Hono() |
|
| 96 | - | ||
| 97 | - | app.use(cors()) |
|
| 98 | - | ||
| 99 | - | app.get('/', (c) => { |
|
| 100 | - | return c.text('Hello Hono!') |
|
| 101 | - | }) |
|
| 102 | - | ||
| 103 | - | app.get('/hello', async (c) => { |
|
| 104 | - | ||
| 105 | - | const data: ApiResponse = { |
|
| 106 | - | message: "Hello BHVR!", |
|
| 107 | - | success: true |
|
| 108 | - | } |
|
| 109 | - | ||
| 110 | - | return c.json(data, { status: 200 }) |
|
| 111 | - | }) |
|
| 112 | - | ||
| 113 | - | export default app; // [!code --] |
|
| 114 | - | export default { // [!code ++] |
|
| 115 | - | async fetch(request: Request, env: any, ctx: any) { // [!code ++] |
|
| 116 | - | return app.fetch(request, env, ctx) // [!code ++] |
|
| 117 | - | } // [!code ++] |
|
| 118 | - | }; // [!code ++] |
|
| 119 | - | ``` |
|
| 120 | - | ||
| 121 | - | #### Deploy Server |
|
| 122 | - | ||
| 123 | - | Move into the `server` package and run the deploy command with the server flag: |
|
| 124 | - | ||
| 125 | - | ```bash [terminal] |
|
| 126 | - | cd server |
|
| 127 | - | ||
| 128 | - | orbiter deploy --server |
|
| 129 | - | ``` |
|
| 130 | - | ||
| 131 | - | This will: |
|
| 132 | - | - Ask which site you want to link the server to (you must already have a client site deployed on Orbiter) |
|
| 133 | - | - Ask for the entry path for your server code (typically `src/index.ts`) |
|
| 134 | - | - Ask for your desired build folder (typically `dist`) |
|
| 135 | - | - Save your preferences to an `orbiter.json` file |
|
| 136 | - | - Build and bundle your server code |
|
| 137 | - | - Deploy it to Orbiter |
|
| 138 | - | ||
| 139 | - | If successful, you'll see a returned URL where you can access your API! |
|
| 140 | - | ||
| 141 | - | :::: |
|
| 142 | - | ||
| 143 | - | ## Environment Variables |
|
| 144 | - | ||
| 145 | - | If you need to use environment variables in your server, create a `.env` file with your values, then include the `--env` flag when deploying: |
|
| 146 | - | ||
| 147 | - | ```bash [terminal] |
|
| 148 | - | orbiter deploy --server --env |
|
| 149 | - | ``` |
|
| 150 | - | ||
| 151 | - | This will automatically scan your `.env` file and include the variables in the deployment. Orbiter will never be able to see your variables, so make sure they are correct! |
|
| 152 | - | ||
| 153 | - | ::::tip |
|
| 154 | - | You can also edit environment variables inside the [Orbiter App](https://app.orbiter.host) |
|
| 155 | - | :::: |
|
| 156 | - | ||
| 157 | - | ## GitHub Actions |
|
| 158 | - | ||
| 159 | - | You can set up GitHub Actions to automatically deploy your server whenever you push to your main branch. |
|
| 160 | - | ||
| 161 | - | Create a `.github/workflows/deploy.yaml` file in the root of your project: |
|
| 162 | - | ||
| 163 | - | ```bash [terminal] |
|
| 164 | - | mkdir -p .github/workflows && touch .github/workflows/deploy.yaml |
|
| 165 | - | ``` |
|
| 166 | - | ||
| 167 | - | Paste the following code into the `deploy.yaml` file: |
|
| 168 | - | ||
| 169 | - | ```yaml |
|
| 170 | - | name: "Deploy to Orbiter" |
|
| 171 | - | ||
| 172 | - | on: |
|
| 173 | - | push: |
|
| 174 | - | branches: [main] |
|
| 175 | - | ||
| 176 | - | jobs: |
|
| 177 | - | deploy: |
|
| 178 | - | runs-on: ubuntu-latest |
|
| 179 | - | steps: |
|
| 180 | - | - name: Checkout code |
|
| 181 | - | uses: actions/checkout@v4 |
|
| 182 | - | ||
| 183 | - | - name: Setup Bun |
|
| 184 | - | uses: oven-sh/setup-bun@v1 |
|
| 185 | - | with: |
|
| 186 | - | bun-version: latest |
|
| 187 | - | ||
| 188 | - | - name: Install dependencies |
|
| 189 | - | run: bun install |
|
| 190 | - | ||
| 191 | - | - name: Deploy to Orbiter |
|
| 192 | - | env: |
|
| 193 | - | ORBITER_API_KEY: ${{ secrets.ORBITER_API_KEY }} |
|
| 194 | - | run: bunx orbiter-cli@latest deploy-server --siteId YOUR_SITE_ID --entryFile src/index.ts --buildDir dist |
|
| 195 | - | ``` |
|
| 196 | - | ||
| 197 | - | Replace `YOUR_SITE_ID` with your actual site ID, which can be found by clicking the "ℹ" icon on the [Orbiter dashboard](https://app.orbiter.host). |
|
| 198 | - | ||
| 199 | - | You'll need to add your Orbiter API key as a repository secret. Navigate to GitHub project Settings > Secrets and Variables > Actions. Click `New repository secret`, then use `ORBITER_API_KEY` as the name, and paste your API key into the box below. |
|
| 200 | - | ||
| 201 | - | ## Further Reference |
|
| 202 | - | ||
| 203 | - | For more information about how to use Orbiter Functions, visit the official docs: |
|
| 204 | - | ||
| 205 | - | <Button href="https://docs.orbiter.host/functions">Orbiter Functions Docs</Button> |
| 127 | 127 | bun run build |
|
| 128 | 128 | ``` |
|
| 129 | 129 | ||
| 130 | - | From there you can select multiple [deployment options](/deployment/client/orbiter) |
|
| 130 | + | From there you can select multiple [deployment options](/deployment/client/cloudflare-pages) |
|
| 131 | 131 | ||
| 132 | 132 | :::: |
|
| 133 | 133 |
| 177 | 177 | ||
| 178 | 178 | ## Deployment |
|
| 179 | 179 | ||
| 180 | - | <Button href="/deployment/client/orbiter">Deployments Section</Button> |
|
| 180 | + | <Button href="/deployment/client/cloudflare-pages">Deployments Section</Button> |
| 58 | 58 | ], |
|
| 59 | 59 | }, |
|
| 60 | 60 | ], |
|
| 61 | - | sponsors: [ |
|
| 62 | - | { |
|
| 63 | - | name: "Partners", |
|
| 64 | - | height: 80, |
|
| 65 | - | items: [ |
|
| 66 | - | [ |
|
| 67 | - | { |
|
| 68 | - | name: "Orbiter", |
|
| 69 | - | link: "https://orbiter.host", |
|
| 70 | - | image: "https://cdn.bhvr.dev/orbiter-logo-3.png", |
|
| 71 | - | }, |
|
| 72 | - | ], |
|
| 73 | - | ], |
|
| 74 | - | }, |
|
| 75 | - | ], |
|
| 76 | 61 | sidebar: [ |
|
| 77 | 62 | { |
|
| 78 | 63 | text: "Getting Started", |
|
| 109 | 94 | collapsed: true, |
|
| 110 | 95 | items: [ |
|
| 111 | 96 | { |
|
| 112 | - | text: "Orbiter", |
|
| 113 | - | link: "/deployment/client/orbiter", |
|
| 114 | - | }, |
|
| 115 | - | { |
|
| 116 | 97 | text: "Cloudflare Pages", |
|
| 117 | 98 | link: "/deployment/client/cloudflare-pages", |
|
| 118 | 99 | }, |
|
| 130 | 111 | text: "Server", |
|
| 131 | 112 | collapsed: true, |
|
| 132 | 113 | items: [ |
|
| 133 | - | { |
|
| 134 | - | text: "Orbiter", |
|
| 135 | - | link: "/deployment/server/orbiter", |
|
| 136 | - | }, |
|
| 137 | 114 | { |
|
| 138 | 115 | text: "Cloudflare Workers", |
|
| 139 | 116 | link: "/deployment/server/cloudflare-workers", |
|