Skip to content

stackql/stackql-deploy-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StackQL Deploy Actions Test StackQL

stackql-deploy

Github Action to execute stackql-deploy to deploy or test a stack. stackql-deploy is a declarative, state-file-less IaC framework, based upon stackql queries.

Usage

Provider Authentication

Authentication to StackQL providers is done via environment variables source from GitHub Actions Secrets. To learn more about authentication, see the setup instructions for your provider or providers at the StackQL Provider Registry Docs.

Inputs

  • command - stackql-deploy command to run (build or test)
  • stack_dir - repo directory containing stackql_manifest.yml and resources dir
  • stack_env - environment to deploy or test (e.g., dev, prod)
  • env_vars - (optional) environment variables or secrets imported into a stack (format: KEY=value,KEY2=value2)
  • env_file - (optional) environment variables sourced from a file
  • show_queries - (optional) show queries run in the output logs
  • log_level - (optional) set the logging level (INFO or DEBUG, defaults to INFO)
  • dry_run - (optional) perform a dry run of the operation
  • custom_registry - (optional) custom registry URL to be used for stackql
  • on_failure - (optional) action on failure (not implemented yet)
  • output_file - (optional) output file to capture deployment outputs (JSON format)

Outputs

  • deployment_outputs - JSON string containing all deployment outputs from stackql-deploy
  • deployment_outputs_file - Path to the deployment outputs file

Examples

Deploy a stack

this example shows how to build a stack (examples/k8s-the-hard-way) for a dev environment:

...
jobs:
  stackql-actions-test:
    name: StackQL Actions Test
    runs-on: ubuntu-latest
    env:
      GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} # add additional cloud provider creds here as needed
    
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Deploy a Stack
        uses: stackql/stackql-deploy-action@v1.0.2
        with:
          command: 'build'
          stack_dir: 'examples/k8s-the-hard-way'
          stack_env: 'dev'
          env_vars: 'GOOGLE_PROJECT=stackql-k8s-the-hard-way-demo'

Deploy a stack with outputs

this example shows how to deploy a stack and capture outputs for use in subsequent steps:

...
jobs:
  deploy:
    name: StackQL Deploy with Outputs
    runs-on: ubuntu-latest
    env:
      GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
    
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Deploy a Stack
        id: stackql-deploy
        uses: stackql/stackql-deploy-action@v1.0.2
        with:
          command: 'build'
          stack_dir: 'examples/k8s-the-hard-way'
          stack_env: 'prod'
          output_file: 'deployment-outputs.json'
          env_vars: 'GOOGLE_PROJECT=stackql-k8s-the-hard-way-demo'

      - name: Use deployment outputs
        run: |
          echo "Deployment outputs: ${{ steps.stackql-deploy.outputs.deployment_outputs }}"
          
          # Parse specific values from JSON output
          WORKSPACE_NAME=$(echo '${{ steps.stackql-deploy.outputs.deployment_outputs }}' | jq -r '.databricks_workspace_name // "N/A"')
          echo "Workspace Name: $WORKSPACE_NAME"
          
          # Add to GitHub Step Summary
          echo "## Deployment Results" >> $GITHUB_STEP_SUMMARY
          echo "Workspace: $WORKSPACE_NAME" >> $GITHUB_STEP_SUMMARY

      - name: Conditional step based on outputs
        if: contains(steps.stackql-deploy.outputs.deployment_outputs, 'RUNNING')
        run: echo "Workspace is running, proceeding with next steps..."

Test a stack

this example shows how to test stack for a given environment:

...
      - name: Test a Stack
        uses: stackql/stackql-deploy-action@v1.0.2
        with:
          command: 'test'
          stack_dir: 'examples/k8s-the-hard-way'
          stack_env: 'sit'
          env_vars: 'GOOGLE_PROJECT=stackql-k8s-the-hard-way-demo'

About

Runs stackql-deploy in your GitHub Actions workflow.

Resources

License

Stars

Watchers

Forks

Packages

No packages published