Skip to content
This repository has been archived by the owner on Feb 14, 2025. It is now read-only.

added the workflow

added the workflow #1

Workflow file for this run

name: Deploy Changes
on:
# ALLOW TRIGGERING ACTION MANUALLY
workflow_dispatch:
# AFTER A PULL REQUEST IS MERGED / CLOSED
pull_request:
types: [closed]
env:
# CS TOOLS IS COMMAND LINE LIBRARY WRAPPING TS APIS
# https://thoughtspot.github.io/cs_tools/tools/git/
CS_TOOLS_VERSION: v1.5.13b1
CS_TOOLS_THOUGHTSPOT__URL: ${{ secrets.PRD_THOUGHTSPOT_URL }}
CS_TOOLS_THOUGHTSPOT__USERNAME: ${{ secrets.PRD_THOUGHTSPOT_USERNAME }}
CS_TOOLS_THOUGHTSPOT__SECRET_KEY: ${{ secrets.PRD_THOUGHTSPOT_SECRET_KEY }}
# THE NAME OF YOUR BRANCH / THOUGHTSPOT ENVIRONMENT.
TS_ENV_NAME: ts-prod
# THE ID OF THE ORG (THOUGHTSPOT ENVIRONMENT MATCHING ENV_NAME).
TS_DESTINATION_ORG_ID: 987654321
jobs:
run_deploy_api:
if: github.event.pull_request.merged && github.event.pull_request.base.ref == '${{ github.env.TS_ENV_NAME }}'
runs-on: ubuntu-latest
steps:
- name: checking ${{ env.TS_ENV_NAME }} branch
uses: actions/checkout@v4
with:
ref: ${{ env.TS_ENV_NAME }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install CS Tools
run: pip install "cs_tools[cli] @ https://github.com/thoughtspot/cs_tools/archive/${{ env.CS_TOOLS_VERSION }}.zip"
- name: Run the GIT DEPLOY command
run: "cs_tools tools git branches deploy --branch-name ${{ env.TS_ENV_NAME }} --org ${{ env.TS_DESTINATION_ORG_ID }} --config ENV:"