Skip to content

Commit 32662ac

Browse files
committed
feat(docs): add docs for env vars with github secrets
1 parent c6c96d6 commit 32662ac

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

docs/src/content/docs/ci-cd/app-releasing-process.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,31 @@ All github workflows are already ready to be used in the starter. You just need
116116

117117
- EXPO_TOKEN: Expo token to authenticate with EAS. You can get generate yours [here](https://expo.dev/settings/access-tokens)
118118

119+
### Github action and env variables
120+
121+
For simplicity, we assume that all your environment variables are already added to your env files and have been pushed to your repository.
122+
123+
If you prefer not to push env files (recommended), you need to add all your environment variables to GitHub secrets. Then, use `create-envfile` action to create the env file on the fly before the prebuild script.
124+
125+
```yaml
126+
## .github/workflows/eas-build-prod.yml
127+
128+
- name: Create envfile
129+
uses: SpicyPizza/[email protected]
130+
with:
131+
envkey_DEBUG: false
132+
envkey_SECRET_KEY: ${{ secrets.PRODUCTION_SECRET_KEY }}
133+
file_name: .env.production
134+
135+
- name: ⏱️ EAS Build
136+
uses: ./.github/actions/eas-build
137+
with:
138+
APP_ENV: production
139+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
140+
```
141+
142+
This action will create a new env file `.env.production` with the `DEBUG` and `SECRET_KEY` variables you added to the action. so make sure to include all your env variables to the action.
143+
119144
## Create new release
120145

121146
For QA release, Go to your GitHub repo actions tab and run `new-app-version` workflow with the your desired release type.
@@ -129,3 +154,7 @@ After successful execution, a new tag will be pushed to master and then `new-git
129154
After that, `eas-build-qa` workflow will be triggered automatically and build the app using EAS and distribute it to the QA team.
130155

131156
For production release, Go to your GitHub repo actions tab and run `eas-build-prod` workflow manually.
157+
158+
```
159+
160+
```

docs/src/content/docs/getting-started/environment-vars-config.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ const _buildTimeEnv = {
6969
NEW_ENV_VAR=my-new-var
7070
```
7171

72+
::: note
73+
if you are not pushing env files to your repo(recomended), please make sure to check the [App releasing process](/ci-cd/app-releasing-process/#github-action-and-env-variables) to see how to create the env file on the fly before the prebuild script in the github actions.
74+
:::
75+
7276
4. Make sure to run `pnpm prebuild` to load the new values.
7377

7478
```bash

0 commit comments

Comments
 (0)