GitHub Actions CI/CD
Automate static asset deployments using the official BFFless GitHub Actions.
Available Actions
| Action | Description |
|---|---|
bffless/upload-artifact | Upload build artifacts to BFFless |
bffless/download-artifact | Download deployed artifacts from BFFless |
bffless/compare-screenshots | Visual regression testing against BFFless baselines |
bffless/compare-coverage | Code coverage regression detection |
Setup
Both actions require the same authentication setup.
1. Get Your API Key
- Go to your BFFless admin panel (
https://admin.yourdomain.com) - Navigate to Settings → API Keys
- Create a new API key
- Copy the key (it won't be shown again)
2. Configure GitHub Secrets
Go to your repository → Settings → Secrets and variables → Actions:
| Type | Name | Value |
|---|---|---|
| Variable | BFFLESS_URL | https://admin.yourdomain.com |
| Secret | BFFLESS_API_KEY | Your 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
- Upload Artifact Action - Deploy builds to BFFless
- Download Artifact Action - Retrieve deployed builds
- Compare Screenshots Action - Visual regression testing
- Compare Coverage Action - Code coverage regression detection