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.
| 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 |
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) |
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) |
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 |
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'
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)
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
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'
npm install
npm run package
This uses @vercel/ncc to compile the action into a single file in the dist folder.
Before publishing, make sure to:
- Build the action:
npm run package - Commit the
distfolder to the repository - Tag your release:
git tag -a v1 -m "Release v1" - Push the tag:
git push origin v1