-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (52 loc) · 2.45 KB
/
deploy-changes-on-push-development.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Unique name for this workflow
name: Deploy development branch to integration and UAT orgs
# Definition when the workflow should run
on:
push:
branches: [ development ]
paths:
- 'force-app/**'
# Jobs to be executed
jobs:
deploy-branch-to-int-and-UAT-orgs:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
# Install Salesforce CLI
- name: 'Install Salesforce CLI'
run: |
wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz
mkdir ~/sfdx
tar xJf sfdx-linux-x64.tar.xz -C ~/sfdx --strip-components 1
echo "$HOME/sfdx/bin" >> $GITHUB_PATH
~/sfdx/bin/sfdx version
# install SFDX-Git-Delta plugin - https://github.com/scolladon/sfdx-git-delta
- name: 'Installing sfdx git delta'
run: |
echo y | sfdx plugins:install sfdx-git-delta
sfdx plugins
# Checkout the source code
- name: 'Checkout source code'
uses: actions/checkout@v3
with:
fetch-depth: 0
# Store secret for both otgs
- name: 'Populate auth file with SFDX_URL secret of the integration and UAT orgs'
shell: bash
run: |
echo ${{ secrets.SFDX_INTEGRATION_URL}} > ./SFDX_INTEGRATION_URL.txt
echo ${{ secrets.SFDX_UAT_URL}} > ./SFDX_UAT_URL.txt
- name: 'Create delta packages for new, modified or deleted metadata'
run: |
mkdir changed-sources
sfdx sgd:source:delta --to "HEAD" --from "HEAD^" --output changed-sources/ --generate-delta --source force-app/
# Authenticate to org
- name: 'Authenticate to Integration Org'
run: sfdx auth:sfdxurl:store -f ./SFDX_INTEGRATION_URL.txt -s -a integration
- name: 'Deploy the entire branch to Integration org'
run: sfdx force:source:deploy -p force-app --testlevel RunLocalTests --json
# Authenticate to org
- name: 'Authenticate to UAT org'
run: sfdx auth:sfdxurl:store -f ./SFDX_UAT_URL.txt -s -a UAT
- name: 'Deploy the entire branch'
run: sfdx force:source:deploy -p force-app --testlevel RunLocalTests --json