Skip to content

Commit

Permalink
minor: added environment variables for analytics to github actions wo…
Browse files Browse the repository at this point in the history
…rkflow
  • Loading branch information
adrienne-deriv committed Sep 26, 2024
1 parent 690317d commit 36bfba6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions .github/workflows/generate_preview_link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:
jobs:
build_and_deploy_preview_link:
runs-on: Ubuntu-latest
environment: Staging
permissions:
checks: write
pull-requests: write
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
environment: Production
env:
RELEASE_TYPE: Production
steps:
Expand All @@ -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:
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
build_and_test:
name: Build and Test
environment: Staging
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 36bfba6

Please sign in to comment.