FerryDocs

Deploy from GitHub Actions

A GitHub Actions job runs the tests, then calls the deploy hook.

Edit on GitHub
.github/workflows/deploy.yml
name: deploy
on:
  push:
    branches: [main]
jobs:
  test-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm test
      - run: curl -fsS -X POST "$FERRY_DEPLOY_HOOK"
        env:
          FERRY_DEPLOY_HOOK: ${{ secrets.FERRY_DEPLOY_HOOK }}

This job deploys after the tests pass. If npm test fails, the job stops before the curl line.

Set it up

Get the URL of the deploy hook

Terminal
ferry deploy-hook show api

The command prints the URL of the . From GitHub, the URL must start with your public dashboard host.

Store the URL as a secret

Store the URL as a secret of your . The job above reads the secret with the name FERRY_DEPLOY_HOOK.

Add the workflow file

Add the file above to your repository.

Turn auto-deploy off

Terminal
ferry update api --no-auto-deploy

If stays on, a push also deploys through the .

On this page