Liftpad / Developers / Developer docs / Quickstart: GitHub Actions

Quickstart: GitHub Actions

Liftpad does not build sites itself yet. GitHub Actions builds the site and deploys it with the CLI: pull requests get a preview, pushes to main go live.

Set it up

  1. In the dashboard, make a deploy token limited to the site's team (how).
  2. In the GitHub repository: Settings, Secrets and variables, Actions, new secret LIFTPAD_TOKEN.
  3. Add .github/workflows/liftpad.yml:
name: Deploy to Liftpad
on:
  push:
    branches: [main]
  pull_request:

permissions:
  contents: read

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      # If the site has a build step:
      # - run: npm ci && npm run build
      - run: curl -fsSL https://liftpad.app/cli/liftpad.mjs -o "$RUNNER_TEMP/liftpad.mjs"
      - name: Deploy (preview on pull requests, live on main)
        if: github.event.pull_request.head.repo.fork != true
        env:
          LIFTPAD_TOKEN: ${{ secrets.LIFTPAD_TOKEN }}
          MESSAGE: ${{ github.event.head_commit.message || github.event.pull_request.title }}
          LIVE: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
        run: |
          node "$RUNNER_TEMP/liftpad.mjs" deploy ./public --site my-site --message "${MESSAGE:0:200}" $([ "$LIVE" = "true" ] && echo --prod)

Change ./public to the folder your build writes, and my-site to the site's name on Liftpad. The log shows the preview address and launch check score of every deploy.

Safety notes