Skip to content

Commit

Permalink
Add demo-rollout flow
Browse files Browse the repository at this point in the history
  • Loading branch information
usulpro committed Jun 24, 2024
1 parent a461827 commit 7ef5d6b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/demo-rollout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Demo Project secrets.ROLL_OUT_API_TOKEN

on:
workflow_dispatch:
inputs:
email:
required: true
type: string
description: user email

jobs:
launch-cli-script:
runs-on: ubuntu-latest
name: Launch CLI script Automatically
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm i

- name: Rollout script
run: pnpm run rollout:action

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"start": "next start",
"lint": "next lint",
"rollout": "./src/rollout-tools/local/cli.mjs",
"rollout:action": "./src/rollout-tools/demo/cli.mjs",
"export-dataset": "sanity dataset export production initial-data.tar.gz",
"test:content-upload": "sanity dataset create testing; sanity dataset import initial-data.tar.gz testing && sanity dataset delete testing --force"
},
Expand Down
10 changes: 10 additions & 0 deletions src/rollout-tools/demo/cli.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env node

if (process.env.GITHUB_ACTIONS !== 'true') {
console.warn(
'Warning: You are running this script locally. This script is intended to be run in a GitHub Actions environment.',
);
process.exit(1);
}

console.log('Script is running...');

0 comments on commit 7ef5d6b

Please sign in to comment.