w9jds / firebase-action

GitHub Action for interacting with Firebase
MIT License
922 stars 198 forks source link

Support process.env #225

Open ThomasKientz opened 5 months ago

ThomasKientz commented 5 months ago

To deploy to hosting with https://github.com/FirebaseExtended/action-hosting-deploy

We can use github actions secrets and variables to set env variables that will be injected into node's env variables and then consumed with process.env:

name: Deploy to Firebase Hosting

env:
  API_KEY: "${{ secrets.API_KEY }}"

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run build
      - uses: FirebaseExtended/action-hosting-deploy@v0          

Would it be possible to support this as well ?

Found this in the repo, it may be the solution : https://github.com/FirebaseExtended/action-hosting-deploy/blob/120e124148ab7016bec2374e5050f15051255ba2/src/deploy.ts#L98

ThomasKientz commented 5 months ago

Found a workaround by using in addition create-env-file action.