NodeOps
UK

Guide

Automate Deployment with GitHub Actions and a CLI

A CI/CD workflow triggered on push that installs a deployment CLI, authenticates, and deploys. Three lines in your GitHub Actions YAML. Every push to main goes live automatically.

The problem

You push to main. Then you open a dashboard, click deploy, wait, and check. For every push. Manual deployment is a time sink that scales linearly with your release frequency. The more often you ship, the more time you waste.

Why automate deployment

Manual deployment does not scale. If you deploy twice a day, that is 20 minutes of clicking per day, 7 hours per month, just on deployment. Automated deployment happens in the background. You push code, CI runs tests, and the CLI deploys. You never open a dashboard.

What you need

Three things: a CI/CD system (GitHub Actions, GitLab CI, etc.), a deployment CLI that supports non-interactive mode, and an API token stored as a CI secret. The workflow installs the CLI, authenticates with the token, and runs the deploy command.

GitHub Actions workflow structure

A deployment workflow has three steps: checkout the code, install and authenticate the CLI, and deploy. The entire YAML is under 20 lines. The CLI handles build, upload, and status polling.

name: Deploy on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install CLI run: curl -sfL https://raw.githubusercontent.com/NodeOps-app/createos-cli/main/install.sh | sh - - name: Deploy run: createos login --token && createos deploy --project ${{ vars.PROJECT_ID }} env: CREATEOS_API_KEY: ${{ secrets.CREATEOS_API_KEY }}

Approaches compared

CLI in GitHub Actions (CreateOS, Vercel, Fly)

Pros

  • Full control over deployment
  • Works with any CI system
  • Can add pre-deploy checks

Cons

  • Requires CI configuration

Best for: Teams that want deployment as part of their CI pipeline

Git-based auto-deploy (Vercel, Netlify)

Pros

  • Zero configuration
  • Deploys on every push automatically

Cons

  • Less control over deployment flow
  • Cannot add custom steps easily

Best for: Frontend projects with simple deployment needs

Webhooks

Pros

  • Platform agnostic
  • Simple to set up

Cons

  • No feedback in CI
  • No status checks
  • Harder to debug failures

Best for: Legacy systems or platforms without CLI support

Automate deployment with CreateOS CLI + GitHub Actions

Here is how to do it step by step using CreateOS CLI.

1

Store your API key as a secret

$ GitHub repo > Settings > Secrets > Actions > New: CREATEOS_API_KEY

Get your API key from CreateOS dashboard > Profile > API Keys. Store it as a GitHub Actions secret.

2

Store your project ID as a variable

$ GitHub repo > Settings > Variables > Actions > New: PROJECT_ID

Get your project ID from createos projects list. Store it as a GitHub Actions variable (not secret, since it is not sensitive).

3

Create the workflow file

$ mkdir -p .github/workflows && touch .github/workflows/deploy.yml

Create the GitHub Actions workflow file in your repository.

4

Add the deploy workflow

$ # See the YAML in the section above

The workflow installs the CLI via curl, authenticates with your API token, and deploys. It runs on every push to main.

5

Push and watch

$ git push origin main

Every push to main now triggers deployment automatically. Check the Actions tab for status.

Frequently asked questions

How do I deploy on every push to main?
Create a GitHub Actions workflow triggered on push to main. The workflow installs your deployment CLI, authenticates with an API token stored as a secret, and runs the deploy command. Total YAML is under 20 lines.
How do I store API keys for CI deployment?
Use GitHub Actions secrets (Settings > Secrets > Actions). Reference them in your workflow as ${{ secrets.YOUR_SECRET }}. Never hardcode API keys in YAML files or commit them to the repository.
Can I deploy only when tests pass?
Yes. Add a test job that runs before the deploy job. Use the needs keyword in GitHub Actions: needs: test. The deploy job only runs if tests pass.
Does this work with GitLab CI and other systems?
Yes. The same pattern works with any CI system. Install the CLI, authenticate with a token, and run the deploy command. The CLI is a standard binary that works on any Linux runner.

Try it yourself

$ brew install createos

100,000+ Builders. One Workspace.

Get product updates, builder stories, and early access to features that help you ship faster.

CreateOS is a unified intelligent workspace where ideas move seamlessly from concept to live deployment, eliminating context-switching across tools, infrastructure, and workflows with the opportunity to monetize ideas immediately on the CreateOS Marketplace.