Skip to content

Commit 780de28

Browse files
committed
Supplement the new env vars with old makefile include
1 parent 41c6f7d commit 780de28

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/actions/deploy-setup/action.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,33 @@ inputs:
1515
runs:
1616
using: "composite"
1717
steps:
18+
- name: Pull infisical secrets into temporary file
19+
uses: Infisical/secrets-action@v1.0.9
20+
with:
21+
method: "oidc"
22+
identity-id: ${{ inputs.infisical_machine_identity_id }}
23+
project-slug: "infra-deployment"
24+
env-slug: ${{ inputs.environment }}
25+
export-type: "file"
26+
file-output-path: "/.env.infisical"
27+
28+
- name: Transform infisical secrets into make include file, load a few as environment variables
29+
id: load-env
30+
run: |
31+
echo ${{ inputs.environment }} > .last_used_env
32+
cat .env.infisical | sed "s/='\(.*\)'$/=\1/g" > .env.${{ inputs.environment }}
33+
34+
# Load environment variables from .env
35+
set -a
36+
. .env.${{ inputs.environment }}
37+
set +a
38+
39+
echo "GCP_REGION=${GCP_REGION}" >> $GITHUB_ENV
40+
echo "GCP_PROJECT_ID=${GCP_PROJECT_ID}" >> $GITHUB_ENV
41+
echo "TERRAFORM_STATE_BUCKET=${TERRAFORM_STATE_BUCKET}" >> $GITHUB_ENV
42+
echo "GH_WORKLOAD_IDENTITY_PROVIDER=${GH_WORKLOAD_IDENTITY_PROVIDER}" >> $GITHUB_ENV
43+
shell: bash
44+
1845
- name: Load environment variables from Infisical
1946
uses: Infisical/secrets-action@v1.0.15
2047
with:

0 commit comments

Comments
 (0)