-
Notifications
You must be signed in to change notification settings - Fork 29
56 lines (47 loc) · 2.08 KB
/
master_push.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
# Unique name for this workflow
name: master
# Definition when the workflow should run
on:
push:
branches: [master]
paths:
- 'force-app/**'
env:
SFDX_INTEGRATION_URL: ${{ secrets.SFDX_INTEGRATION_URL }}
# Jobs to be executed when the above conditions are met
jobs:
# This is the name of the job. You can give it whatever name you want
validate-deployment-on-develop-org:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
# Now we install nodejs in the VM, and specify version 14
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: 'Checkout source code'
uses: actions/checkout@v2
with:
fetch-depth: 0
# Now 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 java as it is required for the next step
# - name: 'Installing java'
# run: sudo apt-get install openjdk-8-jdk
# The URL is stored in the Github Secret named SFDX_INTEGRATION_URL
# so here we store the URL into a text file
- name: 'Populate auth file with SFDX_URL secret of integration org'
shell: bash
run: |
echo $SFDX_INTEGRATION_URL > ./SFDX_INTEGRATION_URL.txt
# Authenticate to org using the URL stored in the text file
- name: 'Authenticate to Integration Org'
run: sfdx auth:sfdxurl:store -f ./SFDX_INTEGRATION_URL.txt -s -a integration
- name: 'Deploy the entire branch to Production org'
run: sfdx force:source:deploy -p force-app --testlevel RunLocalTests --json