Skip to content

Commit

Permalink
Added backup-salesforce-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jawills committed Oct 6, 2024
1 parent 8560332 commit 42d15de
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/backup-salesforce-metadata.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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 * * *"
```

0 comments on commit 42d15de

Please sign in to comment.