From 421dadb866a38459483f36ba4ce97db76a38b84d Mon Sep 17 00:00:00 2001 From: byt3h3ad Date: Thu, 28 Dec 2023 19:24:44 +0530 Subject: [PATCH] new: github/set-environment-for-all-steps.md --- github/set-environment-for-all-steps.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 github/set-environment-for-all-steps.md diff --git a/github/set-environment-for-all-steps.md b/github/set-environment-for-all-steps.md new file mode 100644 index 0000000..d3a85a2 --- /dev/null +++ b/github/set-environment-for-all-steps.md @@ -0,0 +1,17 @@ +# Set environment variables for all steps in a GitHub Action + +From [this example](https://github.com/GoogleCloudPlatform/github-actions/blob/20c294aabd5331f9f7b8a26e6075d41c31ce5e0d/example-workflows/cloud-run/.github/workflows/cloud-run.yml) I learned that you can set environment variables such that they will be available in ALL jobs once at the top of a workflow: + +```yaml +name: Build and Deploy to Cloud Run + +on: + push: + branches: + - master + +env: + PROJECT_ID: ${{ secrets.RUN_PROJECT }} + RUN_REGION: us-central1 + SERVICE_NAME: helloworld-nodejs +```