From 42d15deac40a71e7741900073cf72527158ffd85 Mon Sep 17 00:00:00 2001 From: Justin Wills Date: Sun, 6 Oct 2024 14:13:16 +0200 Subject: [PATCH] Added backup-salesforce-metadata --- .../workflows/backup-salesforce-metadata.yml | 28 +++++++++++++++++++ README.md | 14 +++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/backup-salesforce-metadata.yml diff --git a/.github/workflows/backup-salesforce-metadata.yml b/.github/workflows/backup-salesforce-metadata.yml new file mode 100644 index 0000000..8256c7d --- /dev/null +++ b/.github/workflows/backup-salesforce-metadata.yml @@ -0,0 +1,28 @@ +name: Backup Salesforce Metadata + +on: + schedule: + # Scheduled to run at midnight UTC every day + # UNCOMMENT TO ENABLE + # - cron: "0 0 * * *" + + # Allows manual triggering from the GitHub Actions UI + workflow_dispatch: + +jobs: + backup_metadata: + runs-on: ubuntu-latest + environment: production + steps: + # Step 1: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v3 + + # Step 2: Use local action to perform Salesforce backup and create PR + - name: Backup Salesforce Metadata + uses: jawills/sf-retrieve@v1 + with: + SFDX_AUTH_URL: ${{ secrets.SFDX_AUTH_URL }} + SOURCE_DIR: force-app + BRANCH_NAME: backup + FORCE_PUSH: true diff --git a/README.md b/README.md index ab72992..c7e4d11 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ To add additional environments, clone the `deploy-production.yml` and `validate- We can use [SFDMU](https://github.com/forcedotcom/SFDX-Data-Move-Utility) to move data from Sandbox to Production (Or Vice-Versa). -## Configuration +### Configuration [Full Tutorial Here](https://www.1sync.co/deploy-conga-composer-production) @@ -54,3 +54,15 @@ or to refresh sandbox: cd scripts/conga sh refresh-sb.sh ``` + +## Backup Salesforce Metadata + +We can backup the salesforce metadata nighly (or on-demand) using Github Actions. + +Learn more by following [this]() tutorial. + +**TLDR:** Uncomment the following line in the file `backup-salesforce-metadata.yml` + +```yml +- cron: "0 0 * * *" +```