Deploy
Orbiter makes it easy to deploy a static site, no matter what your preference is! In this doc we’ll go over multiple ways you can deploy with Orbiter.
Web App
The Orbiter App makes it simple to deploy your site. Simply login, click on “Create Site”, then select your File or Folder, give it a domain, and deploy!
Told you it was easy
CLI
If you’re like me (Steve 👋) you probably prefer a CLI flow, and Orbiter has you covered!
First you’ll want to install the CLI by running the following command:
npm i -g orbiter-cli
Once installed you can either authenticate using an API Key (created on the API Keys Page)
orbiter auth
Or by using an OAuth login
orbiter login -p google # or github
If you’re using a framework like Astro or React, go ahead and build it to create the folder that will be uploaded
npm run build
This will create a folder like dist
or out
.
Now you can simply run the deploy
command
orbiter deploy
This will setup your project with an orbiter.json
configuration file that will be referenced for future deployments or updates where you can just run deploy
again!
Automated GitHub Deployments
For those who like to just git push
and forget about it, the Orbiter GitHub Actions are the perfect solution. Check out our guide on how to use them!
API
If you want to build Orbiter deployments elsewhere you can use our API!
First you will want to make an API Key from our API Keys Page from within the Orbiter app.
Orbiter used Pinata to deploy sites to IPFS, so in order to deploy a site through the API you will need to upload it first. Orbiter provides an upload_key
endpoint that will give you a temproary Pinata API key to upload with. Once you upload the file or folder and get the CID back, you can use this CID in the Orbiter API call to create a site.
import { PinataSDK } from "pinata-web3"
const pinata = new PinataSDK({ pinataJwt: "", pinataGateway: ""})
const keyReq = await fetch("https://api.orbiter.host/keys/upload_key", { method: "POST", headers: { "Content-Type": "application/json", "X-Orbiter-API-Key": "<YOUR-API-KEY>" }, body: null})
const keyRes = await keyReq.json()const files: File[] = [] // Get a folder of files either locally or through a front endconst upload = await pinata.upload.fileArray(files).key(keyRes.data)
const deploySite = await fetch("https://api.orbiter.host/sites", { method: "POST", headers: { "Content-Type": "application/json", "X-Orbiter-API-Key": "<YOUR-API-KEY>" }, body: JSON.stringify({ cid: upload.IpfsHash, subdomain: "my-site" })})
To learn what else you can do with our API check out the API Reference!