GitHub Action
DDN Deployment
This repository contains the code to automate the deployment of a Hasura v3 project on Hasura DDN.
A Hasura account is required to use this tool. You can sign up for a free account at Hasura Cloud.
A Hasura Personal Access Token (PAT) is required to authenticate with Hasura Cloud. You can create a PAT from the
Access Tokens
page of Hasura Cloud. You'll then need to
add the following secret to your repository:
hasura-pat: <your-hasura-pat>
In any workflow, add the following step to deploy your Hasura project to Hasura DDN:
- name: Deploy Hasura Project
uses: hasura/[email protected]
with:
hasura-pat: ${{ secrets.hasura-pat }}
build-profile: <The build_profile — including the extension — you wish to use for this deployment>
build-description: <A description to alert other users that this build was created using CI/CD>
Imagine you have a branch called release-stage
that you use to deploy to an environment on DDN called staging
. You
can use the following workflow to deploy your Hasura project to the staging
environment:
name: Deploy to Staging
on:
push:
branches:
- release-stage
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy Hasura Project
uses: hasura/[email protected]
with:
hasura-pat: ${{ secrets.hasura-pat }}
build-profile: build-profile-staging.yaml
build-description: "This build was created using CI/CD"
Note: The build-profile-staging.yaml
file should be present in the root of your repository and should also be
referenced in the hasura.yaml
file.
Similar to the example above, imagine you have a branch called release-prod
that you use to deploy to an environment
on DDN called production
. You can use the following workflow to deploy your Hasura project to the production
environment:
name: Deploy to Production
on:
push:
branches:
- release-prod
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy Hasura Project
uses: hasura/[email protected]
with:
hasura-pat: ${{ secrets.hasura-pat }}
build-profile: build-profile-prod.yaml
build-description: "This build was created using CI/CD"
Note: The build-profile-prod.yaml
file should be present in the root of your repository and should also be
referenced in the hasura.yaml
file.
Check out the deployment guide in our docs 🚀