CI/CD Quick Setup Checklist โ
This is a quick reference checklist for setting up the CI/CD pipeline for Lantern. For detailed instructions, see CICD_GUIDE.md.
Prerequisites โ
- [ ] GitHub repository with workflows in
.github/workflows/ - [ ] Cloudflare account with Pages projects created
- [ ] Firebase projects (dev and prod) set up
- [ ] Discord webhook created
- [ ] Admin access to repository settings
Step 1: Configure GitHub Secrets โ
Go to Settings โ Secrets and variables โ Actions โ New repository secret
Firebase Development (6 secrets) โ
- [ ]
VITE_FIREBASE_API_KEY_DEV - [ ]
VITE_FIREBASE_AUTH_DOMAIN_DEV - [ ]
VITE_FIREBASE_PROJECT_ID_DEV - [ ]
VITE_FIREBASE_STORAGE_BUCKET_DEV - [ ]
VITE_FIREBASE_MESSAGING_SENDER_ID_DEV - [ ]
VITE_FIREBASE_APP_ID_DEV
Firebase Production (6 secrets) โ
- [ ]
VITE_FIREBASE_API_KEY_PROD - [ ]
VITE_FIREBASE_AUTH_DOMAIN_PROD - [ ]
VITE_FIREBASE_PROJECT_ID_PROD - [ ]
VITE_FIREBASE_STORAGE_BUCKET_PROD - [ ]
VITE_FIREBASE_MESSAGING_SENDER_ID_PROD - [ ]
VITE_FIREBASE_APP_ID_PROD
Cloudflare (2 secrets) โ
- [ ]
CLOUDFLARE_API_TOKEN(from Cloudflare dashboard โ API Tokens) - [ ]
CLOUDFLARE_ACCOUNT_ID(from Cloudflare dashboard โ Account)
Firebase CLI (1 secret) โ
- [ ]
FIREBASE_TOKEN(runfirebase login:cito generate)
Discord (1 secret) โ
- [ ]
DISCORD_WEBHOOK_URL(from Discord server settings)
Optional โ
- [ ]
CODECOV_TOKEN(from codecov.io, optional for coverage reports)
Total: 16 required secrets + 1 optional
Step 2: Enable GitHub Actions โ
- [ ] Go to Settings โ Actions โ General
- [ ] Select Allow all actions and reusable workflows
- [ ] Scroll to Workflow permissions
- [ ] Select Read and write permissions
- [ ] โ Check Allow GitHub Actions to create and approve pull requests
- [ ] Click Save
Step 3: Set Up Branch Protection โ
Go to Settings โ Branches โ Add branch protection rule
For main branch โ
- [ ] Branch name pattern:
main - [ ] โ
Require a pull request before merging
- [ ] Required approvals:
1 - [ ] โ Dismiss stale pull request approvals when new commits are pushed
- [ ] Required approvals:
- [ ] โ
Require status checks to pass before merging
- [ ] โ Require branches to be up to date before merging
- [ ] Add required checks (only appear after first run):
- [ ]
lint - [ ]
build - [ ]
test - [ ]
validate-firestore-indexes - [ ]
all-checks-complete
- [ ]
- [ ] โ Require conversation resolution before merging
- [ ] โ Do not allow bypassing the above settings
- [ ] โ Include administrators
- [ ] Click Create
For dev branch โ
- [ ] Repeat above steps with branch name pattern:
dev
Note: Required status checks only appear in the dropdown AFTER they've run at least once. Push a test PR to populate them.
Step 4: Configure Production Environment โ
Go to Settings โ Environments โ New environment
- [ ] Environment name:
production - [ ] โ
Required reviewers
- [ ] Add at least one reviewer who can approve production deployments
- [ ] (Optional) โ
Wait timer:
5minutes - [ ] Click Save protection rules
Step 5: Configure Cloudflare Pages โ
Ensure these Cloudflare Pages projects exist:
Development โ
- [ ]
lantern-app-dev(production branch:dev) - [ ]
lantern-storybook-dev(production branch:dev) - [ ]
lantern-docs-dev(production branch:dev)
Production โ
- [ ]
lantern-app(production branch:main) - [ ]
lantern-storybook(production branch:main) - [ ]
lantern-docs(production branch:main)
Custom domains:
- [ ] dev.ourlantern.app โ lantern-app-dev
- [ ] storybook.dev.ourlantern.app โ lantern-storybook-dev
- [ ] docs.dev.ourlantern.app โ lantern-docs-dev
- [ ] ourlantern.app โ lantern-app
- [ ] storybook.ourlantern.app โ lantern-storybook
- [ ] docs.ourlantern.app โ lantern-docs
Step 6: Deploy Firestore Indexes โ
The workflows will deploy indexes automatically, but they must exist locally:
- [ ] Verify
firestore.indexes.jsonexists and is valid - [ ] Test manual deployment:bash
firebase deploy --only firestore:indexes --project lantern-app-dev firebase deploy --only firestore:indexes --project lantern-app-prod
Step 7: Test CI/CD Pipeline โ
Test CI Workflow โ
[ ] Create a test branch:
bashgit checkout -b test/cicd-setup[ ] Make a small change (add a comment to any file)
[ ] Commit and push:
bashgit add . git commit -m "test: verify CI pipeline" git push origin test/cicd-setup[ ] Open a pull request to
dev[ ] Verify:
- [ ] CI workflow runs automatically
- [ ] All jobs complete successfully (lint, build, test, security, validate-firestore-indexes)
- [ ] "Merge" button is enabled only after checks pass
Test Development Deployment โ
[ ] Merge the test PR to
devbranch[ ] Verify:
- [ ] Deploy to Development workflow triggers
- [ ] All deployments succeed (app, storybook, docs, firebase)
- [ ] Discord notification received
[ ] Check deployed sites:
Test Production Deployment (Optional) โ
[ ] Merge
devtomain(via PR)[ ] Verify:
- [ ] Manual approval required (if environment protection enabled)
- [ ] Deploy to Production workflow triggers after approval
- [ ] All deployments succeed
- [ ] Discord notification received
[ ] Check deployed sites:
Step 8: Enable CodeQL Security Scanning โ
CodeQL should run automatically, but verify:
- [ ] Go to Security โ Code scanning
- [ ] Verify CodeQL workflow ran successfully
- [ ] Check for any alerts
Scheduled: CodeQL runs weekly on Mondays at 6:30 AM UTC
Step 9: Monitor Workflows โ
- [ ] Go to Actions tab
- [ ] Verify all workflows show green checkmarks
- [ ] Click on any workflow to view logs
- [ ] Bookmark this page for future monitoring
Troubleshooting Quick Reference โ
CI Fails: Lint Errors โ
npm run lint:fix
npm run formatCI Fails: Build Errors โ
- Check for TypeScript/JavaScript errors
- Verify environment variables in GitHub Secrets
CI Fails: Test Errors โ
npm testFix failing tests locally
Deployment Fails: Cloudflare API Error โ
- Verify
CLOUDFLARE_API_TOKENis valid - Check token has
Pages:Editpermissions - Verify
CLOUDFLARE_ACCOUNT_IDis correct
Deployment Fails: Firebase Error โ
firebase login:ciUpdate FIREBASE_TOKEN secret with new token
Discord Notification Not Received โ
- Verify
DISCORD_WEBHOOK_URLis correct - Check webhook exists in Discord server
- Test webhook:bash
curl -X POST $DISCORD_WEBHOOK_URL \ -H "Content-Type: application/json" \ -d '{"content": "Test notification"}'
Post-Setup Verification โ
After completing all steps above, verify:
- [ ] All GitHub secrets are set (16 required)
- [ ] Branch protection enabled for
mainanddev - [ ] Production environment configured with approvers
- [ ] Test PR successfully passed CI checks
- [ ] Test deployment to dev environment worked
- [ ] Discord notifications received
- [ ] All deployed sites are accessible
- [ ] CodeQL scan completed without critical issues
Maintenance Schedule โ
Weekly โ
- [ ] Review CodeQL security scan results
- [ ] Check for npm audit warnings in CI logs
Monthly โ
- [ ] Update dependencies:
npm update - [ ] Review and update Firestore indexes if queries changed
- [ ] Verify all deployments are healthy
Quarterly โ
- [ ] Rotate Firebase tokens
- [ ] Rotate Cloudflare API tokens
- [ ] Review and optimize CI/CD workflows
Next Steps โ
Once CI/CD is fully set up:
- [ ] Document any custom configurations in team wiki
- [ ] Train team on PR workflow and CI checks
- [ ] Set up monitoring alerts for failed deployments
- [ ] Consider adding integration tests (E2E tests)
- [ ] Explore performance budgets in CI
Documentation Links โ
- Full CI/CD Guide - Complete documentation
- Branch Protection Setup - Detailed branch protection guide
- Deployment Overview - General deployment information
- Contributing Guide - Development workflow
Questions or issues? Create a GitHub issue with the documentation label or ask in the team Discord channel.