Create Scratch Org 🔔 #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Scratch Org 🔔 | |
# Trigger Events | |
on: | |
workflow_dispatch: | |
inputs: | |
adminEmail: | |
type: string | |
description: "Admin Email Address" | |
required: true | |
branches: | |
- main | |
- develop | |
# Jobs | |
jobs: | |
spin-up-scratch-org: | |
runs-on: ubuntu-latest | |
env: | |
DEV_HUB_AUTH_URL: ${{ secrets.DEV_HUB_AUTH_URL }} | |
SF_CCF_APP_CLIENT_ID: "Invalid_SF_CCF_APP_CLIENT_ID" | |
SF_CCF_APP_CLIENT_SECRET: "Invalid_SF_CCF_APP_CLIENT_SECRET" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
- name: 'Install Salesforce CLI & Authorize DevHub Org' | |
run: | | |
bash ./scripts/deploy/build.sh | |
echo $DEV_HUB_AUTH_URL | bash ./scripts/deploy/authorize_org.sh | |
devHubUsername=$(bash ./scripts/util/get_target_org_alias.sh) | |
sf alias set DEV_HUB=$devHubUsername | |
sf config set target-dev-hub=DEV_HUB | |
sf config list | |
- name: 'Spin Up Brand New Scratch Org' | |
continue-on-error: true | |
run: | | |
inputsFile="inputs.txt" | |
touch $inputsFile | |
# Dev Hub Alias | |
echo "DEV_HUB" >> $inputsFile | |
# Scratch Org Alias | |
echo "New Scratch Org" >> $inputsFile | |
# Admin Email Address | |
echo "${{github.event.inputs.adminEmail}}" >> $inputsFile | |
# Initiate scratch org generation | |
bash ./scripts/automations/create_scratch_org.sh < $inputsFile | |
- name: 'Upload Scratch Org Credentials as Artifact' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: scratch-org-credentials | |
path: build/*scratch-org-credentials.txt | |
if-no-files-found: error | |
retention-days: 5 |