Skip to content

Deploy to BUILD

Deploy to BUILD #30

name: Deploy to BUILD
on:
workflow_dispatch:
inputs:
package:
description: 'The ID (starts with 04t) or alias of the package version to install'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- 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
- name: Authenticate with Sandbox
run: |
echo ${{ secrets.SALESFORCE_BUILD_AUTH }} > sfdxurl.txt
sfdx auth:sfdxurl:store --sfdxurlfile sfdxurl.txt --setalias SAT-BUILD
- name: Remove auth file
run: rm -f ./sfdxurl.txt
- name: Deploy Source in dev-app-pre
run: sfdx force:source:deploy -p dev-app-pre -u SAT-BUILD -w 15 -l RunLocalTests
- name: Install version ID
run: sfdx force:package:install --package "${{ github.event.inputs.package }}" -u SAT-BUILD -b 15 -w 15 --noprompt --wait 10
- name: Re-deploy metadata
run: sfdx force:source:deploy -p force-app/main/default/objects,force-app/main/default/queues -u SAT-BUILD -w 15 -l RunLocalTests
- name: Deploy Source in dev-app-post
run: sfdx force:source:deploy -p dev-app-post -u SAT-BUILD -w 15 -l RunLocalTests
# - name: Deploy destructive changes
# run: sfdx force:mdapi:deploy -d destructiveChanges -u SAT-BUILD -o -g -l RunLocalTests -w 15