Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[frontend] Unable to expose environment variables to frontend build #2624

Open
kwajiehao opened this issue Feb 28, 2023 · 0 comments
Open

[frontend] Unable to expose environment variables to frontend build #2624

kwajiehao opened this issue Feb 28, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@kwajiehao
Copy link

Problem

Currently, ts-template uses a separate deploy repo to deploy to AWS. This repo contains GitHub workflows which build and deploy to AWS. The problem is that we are unable to modify the build configuration for the build and deploy steps because they are defined in this repo to be used with all ts-template projects.

The relevant code can be found in this workflow file:

      - name: Push image to ECR
        id: push-image
        env:
          ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
          ECR_REPOSITORY: ${{ secrets.ecr-repository }}
          IMAGE_TAG: ${{ inputs.image-tag }}
        run: |
          docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
          docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG

This is a problem in particular for frontend projects which want to use non-secret frontend environment variables (such as for Supabase, Datadog RUM, etc.) because we are unable to specify build arguments to the Docker build step.

Expected behavior

There should be an easy way for projects using ts-template to expose frontend env vars in the frontend build step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants