Skip to content

Commit f95f6a6

Browse files
committed
Add .env file creation step in GitHub Actions workflow
1 parent 90623c7 commit f95f6a6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/gh-pages.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
update-analytics:
5656
if: github.event_name == 'schedule'
5757
runs-on: ubuntu-latest
58+
environment: github-pages
5859
permissions:
5960
contents: write # Ensure GitHub Actions can push to the repository
6061
steps:
@@ -83,13 +84,15 @@ jobs:
8384
8485
- run: npm ci
8586

87+
- name: Create .env File
88+
run: |
89+
echo GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} >> .env
90+
echo GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }} >> .env
91+
echo GOOGLE_REFRESH_TOKEN=${{ secrets.GOOGLE_REFRESH_TOKEN }} >> .env
92+
echo PROPERTY_ID=${{ secrets.PROPERTY_ID }} >> .env
93+
8694
- name: Run analytics update
8795
run: npm run analytics
88-
env:
89-
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
90-
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
91-
GOOGLE_REFRESH_TOKEN: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
92-
PROPERTY_ID: ${{ secrets.PROPERTY_ID }}
9396

9497
- name: Build site
9598
run: npm run build

0 commit comments

Comments
 (0)