Post

Part 2: Implementing CI/CD in Salesforce with the Org Development Model

In this follow-up post, we’ll dive into configuring our CI/CD pipelines for the LucidSF_Integration and LucidSF_Prod orgs. Specifically, we’ll prepare secrets for secure authentication and explain the need for this.

Note: This blog post assumes you’ve already set up a GitHub repository for your Salesforce project, ideally mirroring your production environment. If you haven’t, we’ll cover that in a future post.


Reasons for Creating GitHub Secrets for Salesforce Orgs

Creating GitHub Secrets for Salesforce orgs, such as production and integration environments, is essential for maintaining security and ensuring smooth operations in your development and deployment processes. Here are the main reasons for using GitHub Secrets in this context:

  • Separation of Environments: Different Salesforce orgs (e.g., production, integration) often require different configurations. By using GitHub Secrets, you can manage these configurations separately for each environment without exposing sensitive data.
  • Controlled Access: Only authorized workflows and users have access to these secrets, reducing the risk of unauthorized access.
  • Workflow Efficiency: GitHub Actions can utilize these secrets seamlessly in workflows, enabling automated testing, building, and deploying processes specific to each org.
  • Easy Management: You can easily update or rotate secrets in GitHub without changing the code, allowing for better management of credentials across environments.

Creating GitHub Secrets for the Integration Org

To securely connect to your LucidSF_Integration org, we’ll use a GitHub secret:

  1. Open VSCode and connect to your Integration org:
    1
    
    sf org display -o [your INT alias] --verbose
    

    Note: The output will include the Sfdx Auth Url. This is sensitive information, so handle it with care.

  2. In GitHub:
    • Go to your repository’s Settings.
    • Expand Secrets and Variables from the left menu and select Actions.
    • Create a new Repository Secret:
      • Name: SFDX_INTEGRATION_URL
      • Value: Paste the Sfdx Auth Url you copied from VSCode.

N/B: Add an image here showing the GitHub Secrets setup screen. Desktop View Desktop View Where to find your repo settings

Desktop View Click on the New repository secret to create a secret for the integration org

Creating GitHub Secrets for the Production Org

Next, we’ll do the same for the LucidSF_Prod org to prepare for future deployments.

  1. Connect to your Production org using VSCode:
    1
    
    sf org display -o [your PROD alias] --verbose
    
  • Note: Again, take care to keep the Sfdx Auth Url secure.

In GitHub:

  • Go to Settings > Secrets and Variables > Actions. - Create a new Repository Secret:
    • Name: SFDX_PRODUCTION_URL
    • Value: Paste the Sfdx Auth Url from the command output.

N/B: Include an image here showing the creation of the Production secret in GitHub.

What’s Next?

With our GitHub secrets in place, we’re ready to create workflows for deploying to our LucidSF_Integration and LucidSF_Prod orgs. Stay tuned for Part 3, where we’ll configure deployment actions and automate the entire pipeline!

Check out Part 3 of my blog where we set up Github Actions for the LucidSF_Integration and LucidSF_Prod orgs

This post is licensed under CC BY 4.0 by the author.