Skip to content

Commit

Permalink
rename envs in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Frizi committed Oct 21, 2024
1 parent 39aef4c commit 97c6b6b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
37 changes: 25 additions & 12 deletions .github/workflows/bazel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,33 @@ jobs:
repository-cache: true
- uses: actions/checkout@v4
- name: Expose env variables
env:
VITE_API_URL: "${{ vars.ENSO_CLOUD_API_URL }}"
VITE_CHAT_URL: "${{ vars.ENSO_CLOUD_CHAT_URL }}"
VITE_COGNITO_DOMAIN: "${{ vars.ENSO_CLOUD_COGNITO_DOMAIN }}"
VITE_COGNITO_REGION: "${{ vars.ENSO_CLOUD_COGNITO_REGION }}"
VITE_COGNITO_USER_POOL_ID: "${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_ID }}"
VITE_COGNITO_USER_POOL_WEB_CLIENT_ID: "${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID }}"
VITE_ENVIRONMENT: "${{ vars.ENSO_CLOUD_ENVIRONMENT }}"
VITE_GOOGLE_ANALYTICS_TAG: "${{ vars.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG }}"
VITE_SENTRY_DSN: "${{ vars.ENSO_CLOUD_SENTRY_DSN }}"
VITE_STRIPE_KEY: "${{ vars.ENSO_CLOUD_STRIPE_KEY }}"
VITE_ENSO_AG_GRID_LICENSE_KEY: "${{ vars.ENSO_AG_GRID_LICENSE_KEY }}"
VITE_ENSO_MAPBOX_API_TOKEN: "${{ vars.ENSO_MAPBOX_API_TOKEN }}"
run: |
cat << END > app/gui/.env.production
VITE_ENSO_CLOUD_API_URL="${{ vars.ENSO_CLOUD_API_URL }}"
VITE_ENSO_CLOUD_CHAT_URL="${{ vars.ENSO_CLOUD_CHAT_URL }}"
VITE_ENSO_CLOUD_COGNITO_DOMAIN="${{ vars.ENSO_CLOUD_COGNITO_DOMAIN }}"
VITE_ENSO_CLOUD_COGNITO_REGION="${{ vars.ENSO_CLOUD_COGNITO_REGION }}"
VITE_ENSO_CLOUD_COGNITO_USER_POOL_ID="${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_ID }}"
VITE_ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID="${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID }}"
VITE_ENSO_CLOUD_ENVIRONMENT="${{ vars.ENSO_CLOUD_ENVIRONMENT }}"
VITE_ENSO_CLOUD_GOOGLE_ANALYTICS_TAG="${{ vars.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG }}"
VITE_ENSO_CLOUD_SENTRY_DSN="${{ vars.ENSO_CLOUD_SENTRY_DSN }}"
VITE_ENSO_CLOUD_STRIPE_KEY="${{ vars.ENSO_CLOUD_STRIPE_KEY }}"
VITE_ENSO_AG_GRID_LICENSE_KEY="${{ vars.ENSO_AG_GRID_LICENSE_KEY }}"
VITE_ENSO_MAPBOX_API_TOKEN="${{ vars.ENSO_MAPBOX_API_TOKEN }}"
VITE_API_URL="$VITE_API_URL"
VITE_CHAT_URL="$VITE_CHAT_URL"
VITE_COGNITO_DOMAIN="$VITE_COGNITO_DOMAIN"
VITE_COGNITO_REGION="$VITE_COGNITO_REGION"
VITE_COGNITO_USER_POOL_ID="$VITE_COGNITO_USER_POOL_ID"
VITE_COGNITO_USER_POOL_WEB_CLIENT_ID="$VITE_COGNITO_USER_POOL_WEB_CLIENT_ID"
VITE_ENVIRONMENT="$VITE_ENVIRONMENT"
VITE_GOOGLE_ANALYTICS_TAG="$VITE_GOOGLE_ANALYTICS_TAG"
VITE_SENTRY_DSN="$VITE_SENTRY_DSN"
VITE_STRIPE_KEY="$VITE_STRIPE_KEY"
VITE_ENSO_AG_GRID_LICENSE_KEY="$VITE_ENSO_AG_GRID_LICENSE_KEY"
VITE_ENSO_MAPBOX_API_TOKEN="$VITE_ENSO_MAPBOX_API_TOKEN"
VITE_CLOUD_BUILD="false"
END
- run: bazel build //app/gui:dist
Expand Down
7 changes: 0 additions & 7 deletions app/gui/scripts/envReplacer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ const envs = await Promise.all(

const combinedEnvs = Object.assign({}, ...envs)

console.error('==============')
console.error('ENVS:')
console.error(combinedEnvs)

/**
* Map of calls mkdir performed so far, to avoid calling it twice on the same path.
* @type {Map<string, Promise<unknown>>}
Expand Down Expand Up @@ -213,9 +209,6 @@ await processAllFiles()

if (errors.length > 0) {
console.error('==========================')
console.error('cwd:', process.cwd())
console.error('inputDirectory:', inputDirectory)
console.error('outputDirectory:', outputDirectory)
console.error(
`Found ${errors.length} error${errors.length > 1 ? 's' : ''} during bundle postprocessing:`,
)
Expand Down

0 comments on commit 97c6b6b

Please sign in to comment.