Deployment keys provide a secure way to authenticate CI/CD pipelines and automated workflows with Tilda. These keys are scoped to specific projects or sites, following the principle of least privilege.
You can create deployment keys using the Tilda CLI. The key will be scoped to the specified project:
tilda deployment-key create --project myproject
To create a key scoped to a specific site within a project:
tilda deployment-key create --project myproject --site your-site
After creating a key, you'll receive a JSON response containing the key details. Make sure to save this information securely, as the private key will only be shown once.
You can view and manage your deployment keys in the project settings page. Navigate to your project, click on "Settings", and scroll to the "Deployment Keys" section. Here you can:
To use a deployment key in your CI/CD pipeline, set it as an environment variable:
# GitHub Actions
env:
TILDA_CLI_INLINE_IDENTITY_JSON: ${{ secrets.TILDA_DEPLOYMENT_KEY }}
# GitLab CI
variables:
TILDA_CLI_INLINE_IDENTITY_JSON: $TILDA_DEPLOYMENT_KEY
# CircleCI
environment:
TILDA_CLI_INLINE_IDENTITY_JSON: ${TILDA_DEPLOYMENT_KEY}
name: Deploy to Tilda
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install dependencies
run: npm ci
- name: Install Tilda CLI
run: npm install -g @tildacloud/cli
- run: tilda build nextjs
- name: Deploy
env:
TILDA_CLI_INLINE_IDENTITY_JSON: ${{ secrets.TILDA_DEPLOYMENT_KEY }}
run: tilda deploy --project myproject --site mysite
deploy:
stage: deploy
image: node:latest
script:
- npm install -g @tildacloud/cli
- tilda build nextjs
- tilda deploy --project myproject --site mysite
only:
- main
If you receive an "Invalid credentials" error, make sure:
If you get a permission error, verify that: