diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index b3091ebac4d..1cad7a5e7b2 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -5,11 +5,23 @@ inputs: description: "Target Environment" required: true default: staging + rudderstackKey: + description: "Rudderstack key for initialising analytics" + required: true + growthbookDecryptionKey: + description: "Growthbook decryption key for initialising analytics" + required: true + growthbookClientKey: + description: "Growthbook client key for initialising analytics" + required: true runs: using: composite steps: - name: Building dist for ${{ inputs.target }} env: TARGET_ENV: ${{ inputs.target }} + RUDDERSTACK_KEY: inputs.rudderstackKey + GROWTHBOOK_DECRYPTION_KEY: inputs.growthbookDecryptionKey + GROWTHBOOK_CLIENT_KEY: inputs.growthbookClientKey run: node_modules/grunt/bin/grunt releaseci --$TARGET_ENV shell: bash diff --git a/.github/workflows/generate_preview_link.yml b/.github/workflows/generate_preview_link.yml index 2ec2e2880de..e0e6249ad37 100644 --- a/.github/workflows/generate_preview_link.yml +++ b/.github/workflows/generate_preview_link.yml @@ -14,6 +14,7 @@ concurrency: jobs: build_and_deploy_preview_link: runs-on: Ubuntu-latest + environment: Staging permissions: checks: write pull-requests: write @@ -48,11 +49,17 @@ jobs: uses: "./.github/actions/build" with: target: staging + rudderstackKey: vars.RUDDERSTACK_KEY + growthbookDecryptionKey: secrets.GROWTHBOOK_DECRYPTION_KEY + growthbookClientKey: vars.GROWTHBOOK_CLIENT_KEY - name: Build Translations uses: "./.github/actions/build" with: target: translations + rudderstackKey: vars.RUDDERSTACK_KEY + growthbookDecryptionKey: secrets.GROWTHBOOK_DECRYPTION_KEY + growthbookClientKey: vars.GROWTHBOOK_CLIENT_KEY - name: "Run Tests" run: npm run test diff --git a/.github/workflows/release_production.yml b/.github/workflows/release_production.yml index e77ca9ecfa8..5e9bf5fede6 100644 --- a/.github/workflows/release_production.yml +++ b/.github/workflows/release_production.yml @@ -7,6 +7,7 @@ jobs: build_and_test: name: Build and Test runs-on: ubuntu-latest + environment: Production env: RELEASE_TYPE: Production steps: @@ -22,6 +23,9 @@ jobs: uses: "./.github/actions/build" with: target: production + rudderstackKey: vars.RUDDERSTACK_KEY + growthbookDecryptionKey: secrets.GROWTHBOOK_DECRYPTION_KEY + growthbookClientKey: vars.GROWTHBOOK_CLIENT_KEY - name: Versioning uses: "./.github/actions/versioning" with: @@ -35,6 +39,7 @@ jobs: path: dist publish_cloudflare_production: name: Publish to Cloudflare Production + environment: Production runs-on: ubuntu-latest env: RELEASE_TYPE: Production diff --git a/.github/workflows/release_staging.yml b/.github/workflows/release_staging.yml index e69515eeb4b..c925387e89b 100644 --- a/.github/workflows/release_staging.yml +++ b/.github/workflows/release_staging.yml @@ -6,6 +6,7 @@ on: jobs: build_and_test: name: Build and Test + environment: Staging runs-on: ubuntu-latest steps: - name: Checkout @@ -20,10 +21,16 @@ jobs: uses: "./.github/actions/build" with: target: staging + rudderstackKey: vars.RUDDERSTACK_KEY + growthbookDecryptionKey: secrets.GROWTHBOOK_DECRYPTION_KEY + growthbookClientKey: vars.GROWTHBOOK_CLIENT_KEY - name: Build Translations uses: "./.github/actions/build" with: target: translations + rudderstackKey: vars.RUDDERSTACK_KEY + growthbookDecryptionKey: secrets.GROWTHBOOK_DECRYPTION_KEY + growthbookClientKey: vars.GROWTHBOOK_CLIENT_KEY - name: Versioning uses: "./.github/actions/versioning" with: @@ -36,6 +43,7 @@ jobs: path: dist publish_cloudflare_staging: name: Publish to Cloudflare Pages Staging + environment: Staging runs-on: ubuntu-latest needs: [build_and_test] steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c2d8028d6c7..1c2350b7a99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,7 @@ jobs: build_and_test: name: Build and Test runs-on: ubuntu-latest + environment: Production steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 @@ -20,5 +21,8 @@ jobs: uses: "./.github/actions/build" with: target: production + rudderstackKey: vars.RUDDERSTACK_KEY + growthbookDecryptionKey: secrets.GROWTHBOOK_DECRYPTION_KEY + growthbookClientKey: vars.GROWTHBOOK_CLIENT_KEY - name: "Run Tests" run: npm run test