Skip to content

Latest commit

 

History

History
154 lines (119 loc) · 4.6 KB

File metadata and controls

154 lines (119 loc) · 4.6 KB

Next Steps: Making the Project Public

Current State

  • GitHub Actions workflow deploys to Cloudflare R2 CDN on tag pushes
  • Deployment uses GitHub Secrets (CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID, etc.)
  • .env file with credentials is already in .gitignore

Options

Option 1: Keep Everything in One Public Repo (RECOMMENDED)

Best for: Simplicity and transparency

What to do:

  1. Verify .env is in .gitignore (already done ✓)
  2. Ensure all secrets are in GitHub Secrets, not hardcoded (already done ✓)
  3. Make repo public
  4. Optionally add deployment environment protection (see Option 4)

Pros:

  • Simple - single repo to maintain
  • GitHub Actions workflow is visible but safe (uses secrets, not credentials)
  • Community can see and improve your CI/CD process
  • Standard practice for open source projects

Cons:

  • Deployment workflow is public (though this is normal for OSS)

Security notes:

  • GitHub Secrets are encrypted and never exposed in logs
  • Workflow file itself contains no sensitive data
  • Even if someone forks your repo, they won't have your secrets

Option 2: Separate Private Deployment Repo

Best for: Keeping deployment logic completely private

What to do:

  1. Create new private repo: ezcontactform-widget-deploy
  2. Move .github/workflows/release.yml and deploy-cloudflare.sh to private repo
  3. Configure workflow to pull releases from public repo:
    - uses: actions/download-artifact@v3
      with:
        github-token: ${{ secrets.PAT_TOKEN }}
        repository: yourusername/ezcontactform-widget
        workflow: build.yml
  4. Make main repo public (without deployment workflows)

Pros:

  • Complete separation of concerns
  • Deployment process is private
  • Can have different access controls

Cons:

  • More complex - two repos to manage
  • Need Personal Access Token for cross-repo access
  • Duplicated effort for maintenance

Option 3: Public Source + Private Fork for Deployment

Best for: Maintaining both public transparency and private deployment

What to do:

  1. Make current repo public
  2. Create private fork for your own deployments
  3. Keep deployment workflows in private fork only
  4. Pull updates from public repo when needed

Pros:

  • Public repo is clean - just source code
  • Your deployment stays in a controlled private fork
  • Easy to sync changes between repos

Cons:

  • Syncing can be manual
  • Need to manage two repos

Option 4: Use GitHub Environments (Complementary to Option 1)

Best for: Adding extra security to Option 1

What to do:

  1. Create a production environment in GitHub Settings
  2. Add protection rules:
    • Required reviewers
    • Restrict to specific branches (tags)
  3. Move secrets to environment level instead of repo level
  4. Update workflow to use environment:
    jobs:
      build-and-release:
        environment: production

Pros:

  • Extra layer of protection for production deployments
  • Audit trail of who approved deployments
  • Can require manual approval before deploy
  • Works with public repos

Cons:

  • Slightly more complex setup
  • May slow down automated deployments if reviewers required

Recommended Approach

For most users: Option 1 (keep everything in one repo)

Why?

  • It's how most open source projects work (React, Vue, etc.)
  • Your workflow already follows best practices
  • Secrets are properly managed via GitHub Secrets
  • Community can learn from and contribute to your deployment strategy

Action items:

  1. Review .env is in .gitignore ✓ (already done)
  2. Confirm all secrets are in GitHub repo settings
  3. Optionally set up GitHub Environment for extra protection
  4. Make repo public
  5. Update README to document how others can fork and deploy

If you need extra security: Add Option 4 (GitHub Environments)

  • Requires manual approval before each deployment
  • Good for compliance or regulated industries

Files to Review Before Going Public

.env - Already in .gitignore.github/workflows/release.yml - Uses secrets, no hardcoded values ✓ deploy-cloudflare.sh - Uses environment variables

  • README.md - Add section on how to fork and deploy
  • Check for any TODO comments with internal URLs
  • Review commit history for accidentally committed secrets

Alternative: Manual Deployment Only

If you want the simplest approach:

  1. Make repo public
  2. Delete .github/workflows/release.yml from public repo
  3. Deploy manually using deploy-cloudflare.sh locally
  4. Only you can deploy since only you have the credentials

Pros: Maximum simplicity Cons: No automated deployments, manual releases only