Skip to content

Create Scratch Org 🔔 #37

Create Scratch Org 🔔

Create Scratch Org 🔔 #37

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 }}
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
bash ./scripts/deploy/authorize_org.sh --sfdxUrl $DEV_HUB_AUTH_URL --orgAlias DevHub
sf config set target-dev-hub=DevHub
- name: 'Spin Up Brand New Scratch Org'
continue-on-error: true
run: |
inputsFile="inputs.txt"
touch $inputsFile
# Dev Hub Alias
echo "DevHub" >> $inputsFile
# Scratch Org Alias
echo "ScratchOrg" >> $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