Skip to content

Commit 28d82e6

Browse files
authored
Update GitHub Actions workflow for secure deployment
1 parent 31f34ef commit 28d82e6

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

.github/workflows/deploy.yml

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

27-
# 4. Add secrets as environment variables
28-
- name: Set environment variables
29-
run: |
30-
echo "VITE_REACT_APP_EMAILJS_SERVICE_ID=${{ secrets.VITE_REACT_APP_EMAILJS_SERVICE_ID }}" >> $GITHUB_ENV
31-
echo "VITE_REACT_APP_EMAILJS_PUBLIC_KEY=${{ secrets.VITE_REACT_APP_EMAILJS_PUBLIC_KEY }}" >> $GITHUB_ENV
32-
echo "VITE_REACT_APP_EMAILJS_TEMPLATE_ID=${{ secrets.VITE_REACT_APP_EMAILJS_TEMPLATE_ID }}" >> $GITHUB_ENV
33-
34-
# 5. Build the Vite project
27+
# 4. Build the Vite project with environment variables from GitHub Secrets
3528
- 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 }}
3633
run: npm run build
3734

38-
# 6. Deploy to GitHub Pages
35+
# 5. Deploy to GitHub Pages
3936
- name: Deploy to GitHub Pages
4037
uses: peaceiris/actions-gh-pages@v3
4138
with:
4239
publish_dir: './dist' # Path to the built files
43-
github_token: ${{ secrets.GH_IO_PAT }} # Use your stored PAT for authentication
40+
github_token: ${{ secrets.GITHUB_TOKEN }} # Use GitHub's automatically provided token

0 commit comments

Comments
 (0)