Skip to content

Commit 8966067

Browse files
authored
update workflow
1 parent 28d82e6 commit 8966067

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,16 @@ jobs:
2424
- name: Install dependencies
2525
run: npm install
2626

27-
# 4. Build the Vite project with environment variables from GitHub Secrets
27+
# 4. Build the Vite project using secrets directly in the build command
2828
- name: Build Vite project
29-
env:
30-
VITE_REACT_APP_EMAILJS_SERVICE_ID: ${{ secrets.VITE_REACT_APP_EMAILJS_SERVICE_ID }}
31-
VITE_REACT_APP_EMAILJS_PUBLIC_KEY: ${{ secrets.VITE_REACT_APP_EMAILJS_PUBLIC_KEY }}
32-
VITE_REACT_APP_EMAILJS_TEMPLATE_ID: ${{ secrets.VITE_REACT_APP_EMAILJS_TEMPLATE_ID }}
33-
run: npm run build
29+
run: VITE_REACT_APP_EMAILJS_SERVICE_ID=${{ secrets.VITE_REACT_APP_EMAILJS_SERVICE_ID }} \
30+
VITE_REACT_APP_EMAILJS_PUBLIC_KEY=${{ secrets.VITE_REACT_APP_EMAILJS_PUBLIC_KEY }} \
31+
VITE_REACT_APP_EMAILJS_TEMPLATE_ID=${{ secrets.VITE_REACT_APP_EMAILJS_TEMPLATE_ID }} \
32+
npm run build
3433

35-
# 5. Deploy to GitHub Pages
34+
# 5. Deploy to GitHub Pages securely using PAT (Personal Access Token)
3635
- name: Deploy to GitHub Pages
3736
uses: peaceiris/actions-gh-pages@v3
3837
with:
3938
publish_dir: './dist' # Path to the built files
40-
github_token: ${{ secrets.GITHUB_TOKEN }} # Use GitHub's automatically provided token
39+
github_token: ${{ secrets.GH_IO_PAT }} # Use your stored PAT for authentication

0 commit comments

Comments
 (0)