Get your AI-Mediated Learning Assessment Tool running with full chat functionality in 10 minutes!
Problem: You want users to have full AI chat functionality at your hosted URL, but keep API keys secure in your open-source code.
Solution: GitHub Actions + Secrets = Secure deployment with full functionality! 🎉
- GitHub repository
- Azure OpenAI resource (or can create one)
- 5-10 minutes
If you don't have Azure OpenAI yet:
- Go to Azure Portal
- Create "Azure OpenAI" resource
- Go to Azure OpenAI Studio
- Deploy a GPT-4 model
- Note your endpoint URL and deployment name
Collect these 4 values:
✅ AZURE_ENDPOINT: https://your-resource.openai.azure.com/
✅ API_KEY: your-32-character-api-key
✅ DEPLOYMENT: your-model-deployment-name
✅ API_VERSION: 2024-12-01-preview
-
Go to your repository on GitHub
-
Click Settings tab (top of repository page)
-
Click "Secrets and variables" → "Actions" (left sidebar)
-
Click "New repository secret"
-
Add each secret:
Name Value AZURE_ENDPOINThttps://your-resource.openai.azure.com/API_KEYyour-actual-32-character-keyDEPLOYMENTyour-deployment-nameAPI_VERSION2024-12-01-preview
- Repository Settings → Pages (left sidebar)
- Source: Select "GitHub Actions"
- Save
git add .
git commit -m "Enable secure deployment with full functionality"
git push origin mainThat's it! 🎉
- GitHub Actions runs (check Actions tab)
- Config.js gets generated with your secrets (build-time only)
- Site deploys to GitHub Pages with full functionality
- Users get full AI chat at your hosted URL
- Source code stays clean - no API keys visible
After deployment completes (~2 minutes):
https://menonpg.github.io/ai-learning-assessment/
✅ End users: Full AI chat functionality
✅ Your code: Completely secure, no API keys
✅ Deployment: Automated, zero maintenance
✅ Cost: Free hosting on GitHub Pages
✅ Updates: Just push to main branch
-
Check GitHub Actions:
- Go to "Actions" tab in your repository
- Should see green checkmark for deployment
-
Test your live site:
- Visit your GitHub Pages URL
- Complete an assessment
- Try the "Chat with Dr. Menon" feature
-
Verify source code security:
- Check your repository files
- No
config.jsshould be visible - Your API keys are nowhere in the code
Deployment failed?
- Check Actions tab for error details
- Verify all 4 secrets are added correctly
- Make sure Azure OpenAI resource is active
Chat not working on live site?
- Check browser console for errors
- Verify API key permissions in Azure
- Check Azure OpenAI quota/billing
Still need help?
- Check DEPLOYMENT.md for detailed troubleshooting
- Open an issue in the repository
- Monitor usage: Set up billing alerts in Azure
- Test locally: Copy
config.template.jstoconfig.jsfor development - Update secrets: Rotate API keys regularly in GitHub Secrets
- Scale up: Add rate limiting if you get high traffic
🎉 Congratulations! You now have a production-ready, secure AI learning assessment tool that your users can access with full functionality while keeping your API keys completely safe.