diff --git a/.github/workflows/create-sandbox.yml b/.github/workflows/create-sandbox.yml new file mode 100644 index 0000000..29bfdcf --- /dev/null +++ b/.github/workflows/create-sandbox.yml @@ -0,0 +1,44 @@ +name: "Create Salesforce Sandbox" + +on: + workflow_call: + inputs: + definition_file: + description: "Path to definition file" + required: true + type: string + sandbox_name: + description: "Sandbox Name" + required: true + type: string + license: + description: "Sandbox license" + required: false + type: string + default: Developer + secrets: + DEVHUB_SFDX_AUTH_URL: + description: "Devhub auth url" + required: true + +jobs: + create-sandbox: + runs-on: ubuntu-latest + container: + image: flxbl-io/sfp-rc:Mar-23 + + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.git-ref }} + fetch-depth: 0 + + - name: 'Authenticate Dev Hub' + run: | + echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile + sf org login sfdx-url -f authfile -a devhub + + - name: Create Salesforce Sandbox + run: | + sf org create sandbox --alias ${{ inputs.sandbox_name }} -f ${{ inputs.definition_file }} \ + -l ${{ inputs.license }} --name ${{ inputs.sandbox_name }} --target-org devhub --no-prompt --async \ No newline at end of file diff --git a/.github/workflows/refresh-sandbox.yml b/.github/workflows/refresh-sandbox.yml new file mode 100644 index 0000000..c3c2f37 --- /dev/null +++ b/.github/workflows/refresh-sandbox.yml @@ -0,0 +1,39 @@ +name: "Refresh Salesforce Sandbox" + +on: + workflow_call: + inputs: + sandbox_name: + description: "Sandbox Name" + required: true + type: string + definition_file: + description: "Path to definition file" + required: true + type: string + secrets: + DEVHUB_SFDX_AUTH_URL: + description: "Devhub auth url" + required: true + +jobs: + create-sandbox: + runs-on: ubuntu-latest + container: + image: flxbl-io/sfp-rc:Mar-23 + + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.git-ref }} + fetch-depth: 0 + + - name: 'Authenticate Dev Hub' + run: | + echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile + sf org login sfdx-url -f authfile -a devhub + + - name: Refresh Salesforce Sandbox + run: | + sf org refresh sandbox -f ${{ inputs.definition_file }} \ + --name ${{ inputs.sandbox_name }} --target-org devhub --no-prompt --async \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/