Skip to content

Instantly share code, notes, and snippets.

@MillerAdulu
Created August 19, 2023 12:32
Show Gist options
  • Save MillerAdulu/f8b49b685dd268e746f0bb4b511a0837 to your computer and use it in GitHub Desktop.
Save MillerAdulu/f8b49b685dd268e746f0bb4b511a0837 to your computer and use it in GitHub Desktop.
Create a file on the fly
- name: Create .env
run: |
echo "API_KEY_WEB=${{ secrets.API_KEY_WEB }}" >> .env
echo "API_KEY_ANDROID=${{ secrets.API_KEY_ANDROID }}" >> .env
# What this will do is that it will get the key from the secrets in the repository and push
# then into the .env file before you can build your APK or project
@dev-vickie
Copy link

Where will I create this workflow.yaml file,with these instructions? Since I am using a workflow directly from codemagic's website

@MillerAdulu
Copy link
Author

@dev-vickie,

Thought this was a GitHub workflow you were working on. For CodeMagic, ensure to define the variables in the environment Variables section Screenshot 2023-08-20 at 18 17 47

Once you are set, you then go to the Pre-build script section and add the commands
Screenshot 2023-08-20 at 18 24 34

Something of this sort should work.

@dev-vickie
Copy link

dev-vickie commented Aug 21, 2023

Works! Thankyou very much🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment