Skip to content

GitHub Actions

Deploy to Sandbar from GitHub Actions.

name: Deploy to Sandbar
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm run build
- name: Install Sandbar CLI
run: curl -sSL https://sandbar.cloud/install.sh | sh
- name: Deploy
run: sandbar deploy --dir dist
env:
SANDBAR_API_KEY: ${{ secrets.SANDBAR_API_KEY }}
name: Preview
on:
pull_request:
types: [opened, synchronize]
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm run build
- name: Install Sandbar CLI
run: curl -sSL https://sandbar.cloud/install.sh | sh
- name: Deploy Preview
run: sandbar preview --label "pr-${{ github.event.pull_request.number }}"
env:
SANDBAR_API_KEY: ${{ secrets.SANDBAR_API_KEY }}