Skip to content

TonicAI/ephemeral-update-database

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Update an Ephemeral database

A GitHub action to update an Ephemeral database configuration, including when the database expires.

Databases can either:

  • Expire after a specified length of time. For example, expire after 8 hours.
  • Expire after a specified length of inaactivity. For example, expire after the database is inactive for 4 hours.
  • Be active during specified business hours. For example, the database is only active from 7:00 AM to 6:00 PM Monday through Friday.
  • Never expire.

Inputs

Core inputs

Input Description Required Default
ephemeral-url URL to the Ephemeral API No https://ephemeral.tonic.ai
ephemeral-api-key Ephemeral API key Yes -
database-entity-id Identifier of the database to update Yes -
entity-name Name of the Ephemeral database Yes -
database-description Description of the Ephemeral database No ""
expiry-mode Expiration type: static, inactivity, business-hours, or never No never

Static mode inputs

When expiry-mode is static, you must provide the following additional input:

Input Description Required Example
expiry-minutes Number of minutes until the database expires Yes, for static mode 1440 (1 day)
10080 (1 week)

Inactivity mode inputs

When expiry-mode is inactivity, you must provide the following additional input:

Input Description Required Example
inactivity-minutes Number of minutes of inactivity before the database expires Yes, for inactivity mode 60 (1 hour)
1440 (1 day)

Business hours mode inputs

When expiry-mode is business-hours, you provide the following additional input:

Input Description Required Default
business-hours-timezone The timezone to use. For example: America/New_York No America/New_York
business-hours-start-day Start day (Monday-Sunday) No Monday
business-hours-end-day End day (Monday-Sunday) No Friday
business-hours-start-hour Start hour (0-23) No 8
business-hours-end-hour End hour (0-23) No 20

Examples

Never expires (manual management)

The database remains active until it is stopped manually:

- name: Update Ephemeral database
  uses: TonicAI/ephemeral-update-database@v1
  with:
    ephemeral-api-key: ${{ secrets.EPHEMERAL_API_KEY }}
    database-entity-id: 'your-database-entity-id'
    entity-name: 'my-ephemeral-db'
    database-description: 'Development database'

Static duration expiration

The database expires after a fixed amount of time:

- name: Update Ephemeral database (Expires in 7 days)
  uses: TonicAI/ephemeral-update-database@v1
  with:
    ephemeral-api-key: ${{ secrets.EPHEMERAL_API_KEY }}
    database-entity-id: 'your-database-entity-id'
    entity-name: 'feature-test-db'
    database-description: 'Temporary feature testing'
    expiry-mode: 'static'
    expiry-minutes: '10080'  # 7 days (7 * 24 * 60)

Inactivity-based expiration

The database expires after it is inactive for a specified period of time:

- name: Update Ephemeral database (Expires after 2 hours of inactivity)
  uses: TonicAI/ephemeral-update-database@v1
  with:
    ephemeral-api-key: ${{ secrets.EPHEMERAL_API_KEY }}
    database-entity-id: 'your-database-entity-id'
    entity-name: 'dev-db'
    database-description: 'Development environment'
    expiry-mode: 'inactivity'
    inactivity-minutes: '120'  # 2 hours

Business hours expiration

The database shuts down outside of of the specified business hours:

- name: Update Ephemeral database (Active during business hours)
  uses: TonicAI/ephemeral-update-database@v1
  with:
    ephemeral-api-key: ${{ secrets.EPHEMERAL_API_KEY }}
    database-entity-id: 'your-database-entity-id'
    entity-name: 'staging-db'
    database-description: 'Staging environment'
    expiry-mode: 'business-hours'
    business-hours-timezone: 'America/New_York'
    business-hours-start-day: 'Monday'
    business-hours-end-day: 'Friday'
    business-hours-start-hour: '8'
    business-hours-end-hour: '20'

Development

Setup

npm install

Build

npm run package

This uses @vercel/ncc to compile the action into a single file in the dist folder.

Publishing

Before publishing, make sure to:

  1. Build the action: npm run package
  2. Commit the dist folder to the repository
  3. Tag your release: git tag -a v1 -m "Release v1"
  4. Push the tag: git push origin v1

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •