diff --git a/.github/workflows/demo-build.yml b/.github/workflows/demo-build.yml index 148cc3cf2c9..a90a99d6b1b 100644 --- a/.github/workflows/demo-build.yml +++ b/.github/workflows/demo-build.yml @@ -45,7 +45,8 @@ jobs: # Check if demo-page branch exists and create it if necessary if git ls-remote --heads origin demo-page | grep -q "refs/heads/demo-page"; then echo "demo-page exists." - git checkout demo-page + git checkout origin/demo-page + ls -a else echo "demo-page does not exist. Creating an orphan branch." git checkout --orphan demo-page @@ -55,10 +56,17 @@ jobs: fi # Checkout to current branch or tag and create a temporary branch - git checkout $BRANCH_OR_TAG_NAME + git checkout origin/$BRANCH_OR_TAG_NAME git checkout -b temp-$BRANCH_OR_TAG_NAME - git --work-tree=demo-folder checkout demo-page -- . || true + echo "Current branch or tag: temp-$BRANCH_OR_TAG_NAME" + ls -a + + mkdir demo-folder + git --work-tree=demo-folder checkout origin/demo-page -- . + + echo "Demo folder added" + ls -a # Modify and commit changes npm ci @@ -94,18 +102,19 @@ jobs: rm -rf demo-folder/$BRANCH_OR_TAG_NAME # Create a subfolder and checkout demo-page's content - mkdir -p demo-folder/$BRANCH_OR_TAG_NAME/docs + mkdir -p demo-folder/$BRANCH_OR_TAG_NAME/docs/api-tech-docs npm run ts-docs:generate npm run vite-docs:generate # Move the built files and docs into the demo-folder - mv dist demo-folder/$BRANCH_OR_TAG_NAME - mv vite-docs demo-folder/$BRANCH_OR_TAG_NAME/docs - mv ts-docs demo-folder/$BRANCH_OR_TAG_NAME/docs/api-tech-docs + mv dist/* demo-folder/$BRANCH_OR_TAG_NAME + mv vite-docs/* demo-folder/$BRANCH_OR_TAG_NAME/docs + mv ts-docs/* demo-folder/$BRANCH_OR_TAG_NAME/docs/api-tech-docs + + ls -a - find . - rm -rf node_modules + # rm -rf node_modules git add demo-folder git commit -m "Modified contents of demo-page within demo-folder" @@ -114,7 +123,6 @@ jobs: git checkout demo-page git checkout temp-$BRANCH_OR_TAG_NAME -- demo-folder - find . mv demo-folder/* . rm -rf demo-folder