Secure Gmail credentials for GitHub Pages deployment using GitHub Secrets#242
Merged
syed-reza98 merged 3 commits intorezwana-karim-patch-2from Oct 12, 2025
Merged
Conversation
Co-authored-by: rezwana-karim <126201034+rezwana-karim@users.noreply.github.com>
Co-authored-by: rezwana-karim <126201034+rezwana-karim@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update environment variable configuration for GitHub Actions workflow
Secure Gmail credentials for GitHub Pages deployment using GitHub Secrets
Oct 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR updates the GitHub Actions workflow for Next.js to securely configure Gmail email functionality for GitHub Pages production deployment. The implementation addresses issue #240 by adding required environment variables while also fixing a critical security vulnerability.
Changes Made
🔒 Security Enhancement
Critical Fix: The workflow previously contained hardcoded Gmail credentials directly in the YAML file, exposing sensitive information in version control. This has been replaced with GitHub Secrets:
📧 Gmail Integration
Added four new environment variables to enable email functionality via Gmail/Nodemailer:
GMAIL_USER- Gmail email address for sending emailsGMAIL_APP_PASSWORD- Gmail app password for SMTP authenticationGMAIL_FROM- Display name shown in sent emails (e.g., "Wedding email@domain.com")TEST_EMAIL_TO- Test recipient email address for notificationsThese variables are now sourced from GitHub Secrets for security and flexibility.
☁️ Cloudinary Configuration
Set Cloudinary credentials to empty strings as specified for GitHub Pages deployment (Cloudinary integration not used in static export):
📚 Documentation
New File:
GITHUB_SECRETS_SETUP.mdCreated a comprehensive 204-line guide covering:
Updated Documentation
GITHUB_PAGES_DEPLOYMENT.md- Added "Required GitHub Secrets" section with setup instructionsQUICK_DEPLOY_GITHUB_PAGES.md- Updated deployment steps to include all required secretsREADME.md- Added reference to the new secrets setup guideEmail Functionality
The wedding website uses Gmail (via Nodemailer) for:
The email library (
src/lib/email.ts) already supports these environment variables and will work seamlessly once the GitHub Secrets are configured.Setup Required
Repository maintainers need to add the following secrets in Settings → Secrets and variables → Actions:
GMAIL_USER- Your Gmail email addressGMAIL_APP_PASSWORD- Generate at Google Account App PasswordsGMAIL_FROM- Display name for emails (e.g.,"Wedding <email@domain.com>")TEST_EMAIL_TO- Test recipient email addressWEB3FORMS_ACCESS_KEY- Web3Forms API key (may already be configured)Detailed setup instructions are available in the new
GITHUB_SECRETS_SETUP.mdguide.Testing
Benefits
Files Changed
.github/workflows/nextjs.yml- Security enhancement with GitHub SecretsGITHUB_PAGES_DEPLOYMENT.md- Added secrets documentationQUICK_DEPLOY_GITHUB_PAGES.md- Updated setup stepsGITHUB_SECRETS_SETUP.md- NEW: Comprehensive setup guideREADME.md- Added documentation referenceResolves #240
Original prompt
Fixes #241
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.