GitHub Actions Guide
With GitHub Actions, you can trigger AWS preview environments manually from the Actions tab (workflow_dispatch) or automatically whenever a Pull Request opens, updates, or closes.
1. Configure Repository Secrets
In your GitHub repository, navigate to Settings → Secrets and variables → Actions and add the following Repository secrets:
NEOSPAXE_LICENSE_KEY— Your license key from Dodo Payments.AWS_ACCESS_KEY_ID— IAM access key with permissions to provision your preview resources.AWS_SECRET_ACCESS_KEY— IAM secret access key.AWS_REGION— Your target AWS region (e.g.,us-east-1).
2. Add the Deploy Workflow
Create .github/workflows/github-deploy.yml in your repository:
name: Deploy NeoSpaxe preview
on:
workflow_dispatch:
inputs:
stage_name:
description: Stage name
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy
env:
NEOSPAXE_LICENSE_KEY: ${{ secrets.NEOSPAXE_LICENSE_KEY }}
NEOSPAXE_STAGE: ${{ inputs.stage_name }}
NEOSPAXE_ACTION: deploy
NEOSPAXE_API: https://neospaxe.com/functions/v1/neospaxe-engine
NEOSPAXE_WORKSPACE: /workspace
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
run: docker run --rm -v "${{ github.workspace }}:/workspace" -e NEOSPAXE_LICENSE_KEY -e NEOSPAXE_STAGE -e NEOSPAXE_ACTION -e NEOSPAXE_API -e NEOSPAXE_WORKSPACE -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_REGION ghcr.io/toolboxanonymous/neospaxe-engine:latest3. Add the Remove Workflow
Create .github/workflows/github-remove.yml in your repository so you can cleanly tear down any preview stage and stop its hourly runtime clock:
name: Remove NeoSpaxe preview
on:
workflow_dispatch:
inputs:
stage_name:
description: Stage name
required: true
type: string
jobs:
remove:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Remove
env:
NEOSPAXE_LICENSE_KEY: ${{ secrets.NEOSPAXE_LICENSE_KEY }}
NEOSPAXE_STAGE: ${{ inputs.stage_name }}
NEOSPAXE_ACTION: remove
NEOSPAXE_API: https://neospaxe.com/functions/v1/neospaxe-engine
NEOSPAXE_WORKSPACE: /workspace
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
run: docker run --rm -v "${{ github.workspace }}:/workspace" -e NEOSPAXE_LICENSE_KEY -e NEOSPAXE_STAGE -e NEOSPAXE_ACTION -e NEOSPAXE_API -e NEOSPAXE_WORKSPACE -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_REGION ghcr.io/toolboxanonymous/neospaxe-engine:latestBonus: Automate Previews on Every Pull Request
Want the full Vercel experience where opening a PR creates pr-42, pushing new commits updates pr-42 (without paying another stack life fee!), and merging/closing the PR automatically tears it down?
Just set NEOSPAXE_STAGE: pr-${{ github.event.pull_request.number }} on pull_request events:
name: PR Preview Lifecycle
on:
pull_request:
types: [opened, synchronize, reopened, closed]
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run NeoSpaxe Engine
env:
NEOSPAXE_LICENSE_KEY: ${{ secrets.NEOSPAXE_LICENSE_KEY }}
NEOSPAXE_STAGE: pr-${{ github.event.pull_request.number }}
NEOSPAXE_ACTION: ${{ github.event.action == 'closed' && 'remove' || 'deploy' }}
NEOSPAXE_API: https://neospaxe.com/functions/v1/neospaxe-engine
NEOSPAXE_WORKSPACE: /workspace
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
run: docker run --rm -v "${{ github.workspace }}:/workspace" -e NEOSPAXE_LICENSE_KEY -e NEOSPAXE_STAGE -e NEOSPAXE_ACTION -e NEOSPAXE_API -e NEOSPAXE_WORKSPACE -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_REGION ghcr.io/toolboxanonymous/neospaxe-engine:latestWhen PR #42 opens, pr-42 starts a stack life. If you push 12 more commits to that PR while it is open, NeoSpaxe recognizes that pr-42 is an active stack life and updates it in place—zero extra $20 stack life fees. And the moment the PR merges or closes, NEOSPAXE_ACTION=remove destroys the AWS resources and stops the $0.20/hr clock.