Skip to main content

GitHub Actions CI/CD

Automate static asset deployments using the official BFFless GitHub Actions.

Available Actions

ActionDescription
bffless/upload-artifactUpload build artifacts to BFFless
bffless/download-artifactDownload deployed artifacts from BFFless
bffless/compare-screenshotsVisual regression testing against BFFless baselines
bffless/compare-coverageCode coverage regression detection

Setup

Both actions require the same authentication setup.

1. Get Your API Key

  1. Go to your BFFless admin panel (https://admin.yourdomain.com)
  2. Navigate to Settings → API Keys
  3. Create a new API key
  4. Copy the key (it won't be shown again)

2. Configure GitHub Secrets

Go to your repository → Settings → Secrets and variables → Actions:

TypeNameValue
VariableBFFLESS_URLhttps://admin.yourdomain.com
SecretBFFLESS_API_KEYYour API key

Quick Example

A typical CI/CD workflow using both actions:

name: Deploy and Test

on:
push:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: npm ci && npm run build

# Upload the build
- uses: bffless/upload-artifact@v1
with:
path: dist
api-url: ${{ vars.BFFLESS_URL }}
api-key: ${{ secrets.BFFLESS_API_KEY }}
alias: production

e2e-test:
needs: deploy
runs-on: ubuntu-latest
steps:
# Download the deployed build
- uses: bffless/download-artifact@v1
with:
source-path: dist
api-url: ${{ vars.BFFLESS_URL }}
api-key: ${{ secrets.BFFLESS_API_KEY }}
alias: production

- run: npx serve dist & npx playwright test

Next Steps