Integration
MicroStax + GitHub Actions
Use GitHub Actions to automate environment validation, creation, update, and cleanup around pull requests with the same Blueprint and CLI workflows documented elsewhere in MicroStax.
Step 01
PR opened
GitHub Actions can trigger a Blueprint-driven environment workflow when a pull request opens.
Step 02
Sync on every push
Subsequent pushes can update the environment workflow so reviewers stay on the latest branch state.
Step 03
Share the link
The workflow can publish environment details or a controlled share link back into the PR for review.
Step 04
Auto-destroy on merge
Close or merge events can trigger cleanup so short-lived environments do not linger unnecessarily.
Example workflow shape
# .github/workflows/preview.yml
name: Preview Environment
on:
pull_request:
types: [opened, synchronize, reopened, closed]
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install
- name: Validate Blueprint
run: microstax env validate --file ./microstax.yaml
- name: Create or update preview environment
if: github.event.action != 'closed'
run: microstax env create --file ./microstax.yaml
- name: Clean up on close
if: github.event.action == 'closed'
run: microstax env delete <env-id>Also see