Use GitHub Actions to build, test, and publish an application from a Jio VM. The example repository deploys a FastAPI and Next.js app with the Jio v0.2.0 CLI.
Prerequisites
- A public GitHub repository
- A
JIO_API_KEY
The Ubuntu guest needs Python 3.12, Node.js 24 with npm, Git, curl, OpenSSH, and
passwordless sudo. The build installs python3.12-venv when needed and creates
its own .venv.
Add the API key
Open Settings → Secrets and variables → Actions and add JIO_API_KEY.
The key stays on the GitHub runner. The VM clones the public repository anonymously at the exact commit.
Create the workflow
Copy the example's tested workflow:
mkdir -p .github/workflows
curl -fsSL \
https://raw.githubusercontent.com/jiovannish/jio-github-cicd/7ded4d9a609e561a91c809d8078a932024aebfba/.github/workflows/ci.yml \
-o .github/workflows/ci.ymlIt installs Jio v0.2.0, deploys on pushes to main, supports manual runs, records
the public URL in GitHub's production environment, and cleans up failed VMs.
Set JIO_ENDPOINT in the workflow environment when using a custom endpoint.
Create the scripts
Copy the exact runner, guest, and lifecycle-check scripts used by the workflow:
mkdir -p scripts
curl -fsSL \
https://raw.githubusercontent.com/jiovannish/jio-github-cicd/7ded4d9a609e561a91c809d8078a932024aebfba/scripts/deploy.py \
-o scripts/deploy.py
curl -fsSL \
https://raw.githubusercontent.com/jiovannish/jio-github-cicd/7ded4d9a609e561a91c809d8078a932024aebfba/scripts/guest.sh \
-o scripts/guest.sh
curl -fsSL \
https://raw.githubusercontent.com/jiovannish/jio-github-cicd/7ded4d9a609e561a91c809d8078a932024aebfba/scripts/test_deploy.py \
-o scripts/test_deploy.pydeploy.py
creates the VM, checks out the exact commit with jio exec, runs guest.sh,
publishes port 3000 with jio expose, verifies the public page, API, and commit,
then writes the URL to the deployment output and job summary.
guest.sh
installs dependencies, runs backend tests and the Next.js build, then starts both
services. Adapt this script to your application's build and start commands.
FastAPI listens on 127.0.0.1:8000. Next.js listens on 127.0.0.1:3000 and
forwards /api/* to FastAPI. Only port 3000 is public.
Run the workflow
Push to main, or open Actions → Build and deploy on Jio → Run workflow.
Find the URL in the job summary or the repository's production environment.
To update About → Website, optionally add REPO_ADMIN_TOKEN with
Administration: read and write for this repository. Without it, deployment
succeeds and the summary records the skipped update. An invalid token fails that
step after retaining the healthy VM.
Deployment lifecycle
Each run destroys the previous VM, creates a fresh Medium VM, builds, tests, and publishes it. The app is offline during deployment and files do not carry over. The successful VM stays online until the next deployment or manual destruction.
Run the workflow manually with test_failure enabled to test failure cleanup.
It should finish red with no allocated VM remaining:
jio login '<ci-api-key>'
jio usage
jio listThere is no TTL fallback or VM/host restart recovery. Destroy a remaining VM with:
jio destroy '<vm-id>' --yesRead the example's
docs/README.md
for local development and current limitations.