This repository implements a Github Action that's is a variation of the Bitbucket Pipelines examples with org development.
This action is usefull to deploy to non-scratch orgs (sandbox or production) with Github Workflow.
It's a Javascript Github Action, that will once is executed will run the following steps:
- Download and install Salesforce CLI
- Decrypt the certificate
- Auth in the target sandbox/org
- Deploy/Check one or more deploy package
- Deploy/Check destructive changes (optional)
- Execute Data Factory Apex
-
If you intent to use it, please go through the Readme of the referred repo, make sure you understand the concept and execute the Getting Started (of the referred repo) steps #4, 5, 6 and 10
-
Also you will need to add the following Github Secrets on your github repository, that will be later used on your Github Workflow:
- CONSUMER_KEY: holds the client_id of the connected app that you created on step #4 of the referred repo
- USERNAME: holds the username that will be used to connect to the target org/sandbox
- DECRYPTION_KEY: holds the Key value you generated on step #6 of the referred repo - will be used to decrypt the certificate
- DECRYPTION_IV: holds the IV value you generated on step #6 of the referred repo - will be used to decrypt the certificate
You can execute the action as per the following sample:
# Unique name for this workflow
name: On push develop - Deploy to TI01
# Definition when the workflow should run
on:
push:
branches:
- develop
# Jobs to be executed
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
# Checkout the code in the pull request
- name: 'Checkout source code'
uses: actions/checkout@v2
- name: 'Build and Deploy'
uses: tiagonnascimento/sfdx-orgdev-build-deploy@v2
with:
type: 'sandbox'
certificate_path: devops/server.key.enc
decryption_key: ${{ secrets.DECRYPTION_KEY_NON_PRODUCTIVE }}
decryption_iv: ${{ secrets.DECRYPTION_IV_NON_PRODUCTIVE }}
client_id: ${{ secrets.CONSUMER_KEY_TI01 }}
username: ${{ secrets.USERNAME_TI01 }}
checkonly: false
deploy_wait_time: '10'
manifest_path: manifest/package-01.xml,manifest/package-02.xml,manifest/package-03.xml
destructive_path: destructive
data_factory: scripts/apex/CreateBaseData.apex
default_source_path: force-app/main/defaultThe destructive_path input is a path folder, with two files inside. For example if we have the following folder structure
|-- config
|-- devops
|-- force-app
|-- manifest
|-- releases
|-- 01_releases
|-- destructive
|-- package.xml
|-- destructiveChanges.xml
|-- scripts
|-- .forceignore
|-- .gitignore
...
|-- sfdx-project.json The destructive_path will be releases/01_releases/destructive.
If you find any issues or opportunities for improving this repository, fix them! Feel free to contribute to this project by forking this repository and making changes to the content. Once you've made your changes, share them back with the community by sending a pull request. See How to send pull requests for more information about contributing to GitHub projects.
If you find any issues with this demo that you can't fix, feel free to report them in the issues section of this repository.
