close-preview #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: close-preview | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [closed, merged] | |
jobs: | |
preview: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/[email protected] | |
- name: Get lightdash version | |
uses: sergeysova/jq-action@v2 | |
id: version | |
env: | |
LIGHTDASH_URL: ${{ secrets.LIGHTDASH_URL }} | |
with: | |
cmd: curl -s "${LIGHTDASH_URL}/api/v1/health" | jq -r '.results.version' | |
- name: Install lightdash CLI | |
run: npm install -g "@lightdash/cli@${{ steps.version.outputs.value }}" || npm install -g @lightdash/cli@latest | |
- name: Lightdash CLI stop preview | |
env: | |
LIGHTDASH_API_KEY: ${{ secrets.LIGHTDASH_API_KEY }} | |
LIGHTDASH_PROJECT: ${{ secrets.LIGHTDASH_PROJECT }} | |
LIGHTDASH_URL: ${{ secrets.LIGHTDASH_URL }} | |
run: lightdash stop-preview --name ${GITHUB_HEAD_REF##*/} |