Required: true
Description: Action to perform (create/delete)
Required: false
Description: The database name, It's is required to delete the database by name.
Required: false
Description: The region
Required: false
Description: The primary region
Required: false
Description: The read replica regions separated by comma
Required: true
Description: The Upstash account email
Required: true
Description: The Upstash API key
Required: false
Description: Whether to use TLS
Default: true
Description: The database id
Description: The database name
Description: The database type
Description: The region
Description: The port
Description: The creation time
Description: The state
Description: The password
Description: The user email
Description: The endpoint
Description: Whether to use TLS
Description: The rest token
Description: The read only rest token
Description: The direct redis endpoint for TCP connection. Example "redis://user:[email protected]:6379"
name: Create Upstash Redis Database
on:
workflow_dispatch:
jobs:
create_database:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Create Upstash Redis Database
uses: saurabh-git-dev/[email protected]
id: create-upstash-redis
with:
action: "create"
database_name: "test-db"
region: "global"
primary_region: "eu-west-1"
read_replica_regions: "us-east-1"
email: ${{ secrets.UPSTASH_EMAIL }}
api_key: ${{ secrets.UPSTASH_API_KEY }}
tls: true
- name: Output Database Information
run: |
echo "Database ID: ${{ steps.create-upstash-redis.outputs.database_id }}"
echo "Database Name: ${{ steps.create-upstash-redis.outputs.database_name }}"
echo "Database Type: ${{ steps.create-upstash-redis.outputs.database_type }}"
echo "Region: ${{ steps.create-upstash-redis.outputs.region }}"
echo "Port: ${{ steps.create-upstash-redis.outputs.port }}"
echo "Creation Time: ${{ steps.create-upstash-redis.outputs.creation_time }}"
echo "State: ${{ steps.create-upstash-redis.outputs.state }}"
echo "Password: ${{ steps.create-upstash-redis.outputs.password }}"
echo "User Email: ${{ steps.create-upstash-redis.outputs.user_email }}"
echo "Endpoint: ${{ steps.create-upstash-redis.outputs.endpoint }}"
echo "Redis Endpoint: ${{ steps.create-upstash-redis.outputs.redis_endpoint }}"
NOTE: If the database name already exist. It returns the existing database information.
name: Delete Upstash Redis Database
on:
workflow_dispatch:
jobs:
delete_database:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Delete Upstash Redis Database
uses: saurabh-git-dev/[email protected]
id: delete-upstash-redis
with:
action: "delete"
database_name: "test-db"
email: ${{ secrets.UPSTASH_EMAIL }}
api_key: ${{ secrets.UPSTASH_API_KEY }}
NOTE: Does not throw error if database does not exist. So that next steps can be executed without any issue.
In this example, the action is used to create a new Upstash Redis instance named 'test-db' in the global with read replicas and TLS enabled. Make sure to replace secrets.UPSTASH_EMAIL
and secrets.UPSTASH_API_KEY
with your actual secrets in your repository settings.
To get more about usage you can take a look at workflow examples in .github/workflows directory.
To know more about inputs/outputs values you can visit Upstash Docs