Skip to content

Commit

Permalink
GHA : add line to source .env
Browse files Browse the repository at this point in the history
  • Loading branch information
luutuankiet committed Aug 28, 2024
1 parent 008847f commit 824b4cc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/close-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ jobs:
- name: Create .env file from secret
run: |
echo "$PROD_ENV" > .env
echo "$PROD_ENV" > .env
while IFS= read -r line; do
# Skip empty lines and lines starting with #
if [ -n "$line" ] && [[ ! "$line" =~ ^# ]]; then
# Export the variable to $GITHUB_ENV
echo "$line" >> $GITHUB_ENV
fi
done < .env
env:
PROD_ENV: ${{ secrets.PROD_ENV }}

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/gh_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ jobs:
- name: Create .env file from secret
run: |
echo "$PROD_ENV" > .env
while IFS= read -r line; do
# Skip empty lines and lines starting with #
if [ -n "$line" ] && [[ ! "$line" =~ ^# ]]; then
# Export the variable to $GITHUB_ENV
echo "$line" >> $GITHUB_ENV
fi
done < .env
env:
PROD_ENV: ${{ secrets.PROD_ENV }}

Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/start-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ jobs:
- name: Create .env file from secret
run: |
echo "$PROD_ENV" > .env
echo "$PROD_ENV" > .env
while IFS= read -r line; do
# Skip empty lines and lines starting with #
if [ -n "$line" ] && [[ ! "$line" =~ ^# ]]; then
# Export the variable to $GITHUB_ENV
echo "$line" >> $GITHUB_ENV
fi
done < .env
env:
PROD_ENV: ${{ secrets.PROD_ENV }}

Expand Down

0 comments on commit 824b4cc

Please sign in to comment.