Skip to main content

Github Action for Deploying GraphQL

The Github Action tailcallhq/gh-action can be used to easily deploy a tailcall server to any supported cloud provider. Currently, AWS Lambda and Fly are supported.

Deploying to Fly

Below is an example of how to deploy a tailcall server to Fly using the tailcallhq/gh-action action.

on: [push]

jobs:
deploy_tailcall:
runs-on: ubuntu-latest
name: Deploy Tailcall
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Deploy Tailcall
id: deploy-tailcall
uses: tailcallhq/gh-action@<version> # Replace <version> with the desired version
with:
provider: "fly" # Specifies the cloud provider as 'fly'
fly-api-token: ${{ secrets.FLY_API_TOKEN }}
fly-app-name: "tailcall"
fly-region: "lax"
tailcall-config: "config.graphql"

Inputs for tailcallhq/gh-action

Following are the inputs for the tailcallhq/gh-action action when deploying to Fly:

InputDescription
providerWhen deploying to Fly, this should be set to fly.
tailcall-configThe path of the tailcall configuration file.
tailcall-versionSpecifies the version of tailcall to use for deployment. If not provided, the Action defaults to the latest available version.
fly-api-tokenThe Fly API token required for authentication. Ensure this value is stored securely, such as in GitHub Secrets.
fly-app-nameThe name of the Fly app being deployed. Defaults to <orgname>-<reponame> if not specified.
fly-regionThe region where the Fly app will be deployed. Defaults to ord if not specified.

Deploying to AWS Lambda

on: [push]

jobs:
deploy_tailcall:
runs-on: ubuntu-latest
name: Deploy Tailcall
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Deploy Tailcall
id: deploy-tailcall
uses: tailcallhq/gh-action@<version> # Replace <version> with the desired version
with:
provider: "aws"
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: "us-east-1"
aws-iam-role: "iam_for_tailcall"
terraform-api-token: ${{ secrets.TERRAFORM_API_TOKEN }}
tailcall-config: "config.graphql"

Inputs for tailcallhq/gh-action

Following are the inputs for the tailcallhq/gh-action action when deploying to AWS Lambda:

InputDescription
providerWhen deploying to AWS Lambda, this should be set to aws.
tailcall-configThe path to the tailcall configuration file used for deployment.
tailcall-versionSpecifies the version of tailcall to use for deployment. If not provided, the Action defaults to the latest available version.
aws-access-key-idThe AWS access key ID required for authentication. Ensure this value is stored securely, such as in GitHub Secrets.
aws-secret-access-keyThe AWS secret access key required for authentication. Store this securely, such as in GitHub Secrets.
aws-regionThe AWS region where the Lambda function will be deployed (e.g., us-east-1).
aws-iam-roleThe IAM role name to be created and used for the deployment. If not specified, defaults to iam_for_tailcall.
aws-lambda-function-nameThe name assigned to the created Lambda function. Defaults to tailcall if not specified.
terraform-api-tokenThe Terraform Cloud API token required for authentication. Ensure this value is stored securely, such as in GitHub Secrets.