I have configured a dev environment with a Firebase secret, but I can’t write it to my .env.local
file when running the CI. Only repository-level secrets work.
How can I access my environment secret?
jobs:
Deploy-Application:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create .env file
run: |
cd /tmp/app
touch .env.local
echo FIREBASE_DSN=${{ secrets.FIREBASE_DSN }} >> .env.local
2
Answers
I reformulate my need more simply
I have 3 environments
Each of these environments has the FIREBASE_DSN secret with a value specific to its environment:
Secrets are linked to an environment so detection should be done automatically, but there is no variable proposed by github to automatically detect the environment, this does not work. Is the only solution to copy my .yaml file 3 times?
You have to specify the environment as part of the job: