From 1b28ccbb05e7a2e3e0bfaa7b75aa5a28393bca46 Mon Sep 17 00:00:00 2001 From: neel-astro Date: Tue, 3 Sep 2024 14:55:11 +0530 Subject: [PATCH] fix logic cli install logic and add log grouping --- README.md | 27 +++++++++++++++++++++++++++ action.yaml | 6 +++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c43cecd..bcf49b2 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,33 @@ jobs: deployment-id: ``` +## DBT Deploy to Deployment Preview + +```yaml +name: Astronomer - DBT Deploy code to Preview + +on: + pull_request: + branches: + - main + +env: + ## Sets Deployment API key credentials as environment variables + ASTRO_API_TOKEN: ${{ secrets.ASTRO_API_TOKEN }} + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Deploy to Deployment Preview + uses: astronomer/deploy-action@v0.6 + with: + action: dbt-deploy-deployment-preview + deployment-id: + root-folder: dbt/ + mount-path: /dbt +``` + ## Delete Deployment Preview ```yaml diff --git a/action.yaml b/action.yaml index 518b234..6344cf0 100644 --- a/action.yaml +++ b/action.yaml @@ -300,7 +300,7 @@ runs: run: | echo ::group::Get DBT Deploy Options - if [[ "${{ inputs.action }}" != "dbt-deploy" || "${{ inputs.action }}" != "dbt-deploy-deployment-preview" ]]; then + if [[ "${{ inputs.action }}" != "dbt-deploy" && "${{ inputs.action }}" != "dbt-deploy-deployment-preview" ]]; then echo "skipping the steps since the action is not dbt-deploy or dbt-deploy-deployment-preview" echo "DBT_DEPLOY=0" >> $GITHUB_OUTPUT exit 0 @@ -353,7 +353,7 @@ runs: echo ::group::Get Deployment Type # skip if the action is DBT Deploy if [[ "${{ inputs.action }}" == "dbt-deploy" || "${{ inputs.action }}" == "dbt-deploy-deployment-preview" ]]; then - echo "skipping the steps since the action is dbt-deploy" + echo "skipping the steps since the action is one of dbt-deploy or dbt-deploy-deployment-preview" exit 0 fi @@ -409,7 +409,7 @@ runs: echo ::group::Setup Deploy Options # skip if the action is DBT Deploy if [[ "${{ inputs.action }}" == "dbt-deploy" || "${{ inputs.action }}" == "dbt-deploy-deployment-preview" ]]; then - echo "skipping the steps since the action is dbt-deploy" + echo "skipping the steps since the action is one of dbt-deploy or dbt-deploy-deployment-preview" exit 0 fi