Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/promote-playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Promote playground on tag

on:
push:
tags:
- "@onflow/**"

permissions:
contents: write

concurrency:
group: promote-playground
cancel-in-progress: false

jobs:
promote:
runs-on: ubuntu-latest
steps:
- name: Checkout with full history
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Move playground branch to tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

TAG="${GITHUB_REF_NAME:-${GITHUB_REF##*/}}"
git fetch --tags
git show --no-patch --pretty=fuller "$TAG"

# Create/update branch at the tag commit and push
git branch -f playground "$TAG"
git push --force-with-lease origin playground
53 changes: 53 additions & 0 deletions packages/demo/DEPLOY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Playground Deployment Workflow

## How It Works

The `playground` branch always points to the latest release tag and is deployed to Vercel.

**Key principle:** Playground = released version.

## Automatic Sync

### When

- Automatically on every package release (e.g., `@onflow/[email protected]`)
- Triggered by changesets when tags are created

### What happens

1. Workflow detects new release tag
2. Force-updates playground branch to point at the tag
3. Vercel deploys the tagged release

## Emergency Hotfixes

If demo needs urgent fix before next release:

### Option 1: Patch Release

Create a patch release for demo package only with changeset.

### Option 2: Manual Fix

```bash
git checkout playground
# Fix demo files only (packages/demo/**)
git commit -m "fix(demo): emergency hotfix"
git push origin playground
```

**Warning:** Next release will overwrite playground. Emergency fix MUST go in next release!

## Rules

### DO

- Let the workflow handle normal releases
- Create patch releases for important fixes
- Only manually fix demo files (`packages/demo/**`)
- Ensure emergency fixes go in next release

### DON'T

- Don't let emergency fixes skip the next release
- Don't use manual fixes for non-critical issues