You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Templating system implemented in #2251, android and ios config migrated, so all that remains should be firebase hosting config files (firebase.json, .firebaserc) and related github actions.
Recommend creating a yarn workflow firebase command that by default calls a child configure command (also available as yarn workflow firebase configure), which populates the variables, ideally providing default values from the firebase config where possible (e.g. default hosting id same as project id?), and throwing an error if firebase config not set.
Once workflow configured github actions should be updated to call.
Alternatively could still use github actions/shell scripts to replace, but just replace variables instead of writing entire template. The minor benefit to this approach would be not having to checkout and install node_modules for a second time as the build action happens in isolation (see similar changes in #2278)
What?
Some github actions use custom scripting to populate files using variables stored in github actions context. These scripts can be a little verbose and hard to adapt, and are somewhat detached from local workflows.
It might be more useful to implement a templating system that can be used either as part of github actions or locally to populate files as required.
How?
There's no shortage of tools around for templating, however preferably it would be good to find one that can be run both locally and as part of CI. Given that github actions can execute any javascript actions directly it may be preferable to use a javascript/node-based solution as opposed to one that is installed through docker, or at least a templating syntax that is interoperable.
It might also be worth considering creating a custom github action for handling this (or using existing). Github action providers typescript and javascript starter templates, e.g. https://github.dev/actions/typescript-action
chrismclarke
changed the title
[FEATURE] - Populate reusable action config files from templates
[FEATURE] - Templated firebase hosting and actions
Mar 27, 2024
Update 2024-03-26
Templating system implemented in #2251, android and ios config migrated, so all that remains should be firebase hosting config files (firebase.json, .firebaserc) and related github actions.
Recommend creating a
yarn workflow firebase
command that by default calls a childconfigure
command (also available asyarn workflow firebase configure
), which populates the variables, ideally providing default values from the firebase config where possible (e.g. default hosting id same as project id?), and throwing an error if firebase config not set.Once workflow configured github actions should be updated to call.
Alternatively could still use github actions/shell scripts to replace, but just replace variables instead of writing entire template. The minor benefit to this approach would be not having to checkout and install node_modules for a second time as the build action happens in isolation (see similar changes in #2278)
What?
Some github actions use custom scripting to populate files using variables stored in github actions context. These scripts can be a little verbose and hard to adapt, and are somewhat detached from local workflows.
E.g. reusable-deploy-pr-preview action
It might be more useful to implement a templating system that can be used either as part of github actions or locally to populate files as required.
How?
There's no shortage of tools around for templating, however preferably it would be good to find one that can be run both locally and as part of CI. Given that github actions can execute any javascript actions directly it may be preferable to use a javascript/node-based solution as opposed to one that is installed through docker, or at least a templating syntax that is interoperable.
It might also be worth considering creating a custom github action for handling this (or using existing). Github action providers typescript and javascript starter templates, e.g. https://github.dev/actions/typescript-action
Other details
Example tools to consider:
Example of template file that could be used as generator for
.firebaserc
(env_substr format)Current code used to generate
.firebaserc
The text was updated successfully, but these errors were encountered: