diff --git a/.github/workflows/rill-ui.yml b/.github/workflows/rill-ui.yml index 7a14320ad7f..3a97eae2ea1 100644 --- a/.github/workflows/rill-ui.yml +++ b/.github/workflows/rill-ui.yml @@ -39,26 +39,23 @@ jobs: with: node-version: 16 - - name: Setup Env variables from Inputs - env: - ENV: ${{ inputs.env }} - RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }} + - name: Setup Env variables from Inputs for Prod + if: ( github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') ) || ( github.event_name == 'workflow_dispatch' && inputs.env == 'prod' ) + run: |- + echo "NETLIFY_SITE_ID=afb26917-7a60-47d9-81dc-c0babbb0d9a9" >> $GITHUB_ENV + echo "DOMAIN=rilldata.com" >> $GITHUB_ENV + + - name: Setup Env variables from Inputs for Stage + if: ( github.event_name == 'push' && startsWith(github.ref_name, 'release') ) || ( github.event_name == 'workflow_dispatch' && inputs.env == 'stage' ) + run: |- + echo "NETLIFY_SITE_ID=e73ac785-882e-425a-8fc8-5432528bb374" >> $GITHUB_ENV + echo "DOMAIN=rilldata.io" >> $GITHUB_ENV + + - name: Setup Env variables from Inputs for Test + if: ( github.event_name == 'push' && startsWith(github.ref_name, 'main') ) || ( github.event_name == 'workflow_dispatch' && inputs.env == 'test' ) run: |- - # if push is via tag, should be deployed to prod - # if push is to release branch, should be deployed to stage - # else go to test, workflow_dispatch can choose the environment. - if [[ ( $GITHUB_EVENT_NAME == "push" && $RELEASE == "true" ) || ( $GITHUB_EVENT_NAME == "workflow_dispatch" && $ENV == "prod" ) ]]; then - echo "NETLIFY_SITE_ID=afb26917-7a60-47d9-81dc-c0babbb0d9a9" >> $GITHUB_ENV - echo "DOMAIN=rilldata.com" >> $GITHUB_ENV - else - if [[ ( $GITHUB_EVENT_NAME == "push" && $GITHUB_REF_NAME =~ "release.*" ) || ( $GITHUB_EVENT_NAME == "workflow_dispatch" && $ENV == "stage" ) ]]; then - echo "NETLIFY_SITE_ID=e73ac785-882e-425a-8fc8-5432528bb374" >> $GITHUB_ENV - echo "DOMAIN=rilldata.io" >> $GITHUB_ENV - else - echo "NETLIFY_SITE_ID=ad7b8d67-9b24-4b2a-8985-1a80b7b0ab11" >> $GITHUB_ENV - echo "DOMAIN=rilldata.in" >> $GITHUB_ENV - fi - fi + echo "NETLIFY_SITE_ID=ad7b8d67-9b24-4b2a-8985-1a80b7b0ab11" >> $GITHUB_ENV + echo "DOMAIN=rilldata.in" >> $GITHUB_ENV - name: Build Cloud UI run: |-