name: Deploy to production run-name: ${{ GITHUB.ACTOR }} pushing to main on: push: branches: - OrgDestination jobs: deploy: runs-on: ubuntu-latest steps: # checkout repository - name: Checkout repository uses: actions/checkout@v7 # install Salesforce CLI - name: Install Salesforce CLI run: npm install --global @salesforce/cli # Create JWT key - name: Create JWT key run: | mkdir -p .secrets printf '%s' "${{ secrets.SF_JWT_KEY}}" > .secrets/server.key chmod 600 .secrets/server.key # Authenticate - name: Authenticate run: | sf org login jwt \ --client-id "${{ secrets.SF_CLIENT_ID }}" \ --jwt-key-file .secrets/server.key \ --username "${{ vars.SF_DESTINATION_USERNAME }}" \ --instance-url https://login.salesforce.com \ --alias OrgDestination # Deploy - name: Deploy run: | sf project deploy start \ --source-dir force-app \ --target-org OrgDestination \ --wait 2 # Remove JWT key # - name: Remove JWT key # if: always() # run: rm -f .secrets/server.key \