SC-85409 | Build and deploy demonstration previews on pull requests #9
Workflow file for this run
This file contains hidden or 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
# AC: | |
# - v2_build_demos workflow runs when a commit is pushed to a pull request | |
# - Only changed/added demos should be built on a commit | |
# - Changed demos are deployed as previews | |
# - PRs targeting the dev branch use development dependencies | |
# - PRs targeting master use the stable dependencies (constraints.txt) | |
# We want to create a Workflow that runs on pull requests to the dev branch and master branch | |
# depending on if the branch is dev or master, we want to use different dependencies | |
# we want to use the stable dependencies for master and the development dependencies for dev, so we will need to check the branch being targeted and determine which dependencies to use. The workflow "Build V2 Demos" has a bool variable for this | |
name: Build V2 Demos on Pull Request | |
on: | |
pull_request: | |
branches: [master, dev] | |
# Runs on pull requests where the target branch is dev or master | |
concurrency: | |
group: build-v2-demos-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if PR is a fork | |
if: github.event.pull_request.head.repo.full_name != github.repository | |
run: | | |
echo "This workflow does not run on forks, and requires a review before being merged into a branch for testing and secondary or final review." | |
exit 1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# - name: Get Changed Demos | |
# id: changed-demos | |
# uses: ./.github/actions/get-changed-demos | |
# with: | |
# json: true | |
- name: Build | |
uses: ./.github/workflows/v2-build-demos.yml | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
demo-names: 'gbs' | |
dev: ${{ github.event.pull_request.base.ref == 'dev' }} | |
save-artifact: true | |
artifact-name: demo-build-${{ github.event.pull_request.head.sha }} | |
keep-going: false | |
quiet: false | |
batch_size: 10 | |
- name: Deploy | |
run: | | |
# Deploy the built demos to a preview environment | |
# This is a placeholder for the actual deployment step | |
echo "Deploying demos..." | |
# Add your deployment commands here |