From 0047f7978402d0080e00521e4b8c57579db85f59 Mon Sep 17 00:00:00 2001 From: GandyA23 Date: Tue, 30 Apr 2024 04:47:04 +0000 Subject: [PATCH] fix(deploy.yml): Fix .env file to project when built --- .github/workflows/deploy.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ded529d..a2cf318 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,6 +14,13 @@ jobs: - uses: actions/setup-node@v3 with: node-version: "20" + # Create .env file before build project + - name: 'Create env file' + run: | + touch .env + echo RECAPTCHA_SITE_KEY=${{ secrets.RECAPTCHA_SITE_KEY }} >> .env + echo DEVTOOLS=${{ vars.DEVTOOLS }} >> .env + echo API_FORM_URL=${{ vars.API_FORM_URL }} >> .env # Pick your own package manager and build script - run: npm install - run: npx nuxt build --preset github_pages @@ -25,11 +32,6 @@ jobs: deploy: # Add a dependency to the build job needs: build - # Environment variables in repository - env: - RECAPTCHA_SITE_KEY: ${{ secrets.RECAPTCHA_SITE_KEY }} - DEVTOOLS: ${{ vars.DEVTOOLS }} - API_FORM_URL: ${{ vars.API_FORM_URL }} # Grant GITHUB_TOKEN the permissions required to make a Pages deployment permissions: pages: write # to deploy to Pages