Set it up
- In the dashboard, make a deploy token limited to the site's team (how).
- In the GitHub repository: Settings, Secrets and variables, Actions, new secret
LIFTPAD_TOKEN. - 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
- The commit message reaches the command through the environment, never pasted into it: a commit message is untrusted text.
- Pull requests from forks do not get the secret (GitHub's rule). The if: line skips the deploy step for them, so they show a skipped step instead of a failed check (without it, the CLI stops with Missing token).
- Give the token an expiry and replace it before it ends.