Skip to content

Deploy from CI

In CI, set FALAK_URL and FALAK_TOKEN and call falak deploy --wait. The job streams the deployment output and fails when the deployment fails (exit code 3).

Create a token under Settings → API tokens with only what CI needs:

Ability Why
deployments.create Trigger deployments
deployments.view Poll status and output
sites.view Resolve the site

Store it as a secret in your CI (FALAK_TOKEN). Set an expiry if your policy requires rotation.

.github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
needs: [] # e.g. [test]
steps:
- name: Install falak
run: |
curl -fsSL -o /usr/local/bin/falak \
https://github.com/OthmanHaba/falak/releases/latest/download/falak-linux-amd64
chmod +x /usr/local/bin/falak
- name: Deploy
env:
FALAK_URL: https://falak.example.com
FALAK_TOKEN: ${{ secrets.FALAK_TOKEN }}
run: falak deploy shop --branch "${GITHUB_REF_NAME}" --wait
Terminal window
falak --json deploy shop --wait > deployment.json # output lines on stderr
jq -r '.status' deployment.json # succeeded

Turn push-to-deploy off for sites you deploy from CI, or every push triggers two deployments. Pick one trigger per site.