8989
9090  preview :
9191    runs-on : ubuntu-latest 
92-     needs :
93-       - build 
94-       - test 
92+     needs : build 
9593    if : ${{ needs.build.outputs.any-workspace == 'true' }} 
96-     strategy :
97-       fail-fast : false 
98-       matrix :
99-         package : ${{ fromJSON(needs.build.outputs.packages) }} 
100-         exclude :
101-           - package : global 
102-           - package : any-workspace 
103-     name : Preview ${{ matrix.package }} on GH Pages 
94+     name : Publish preview playgrounds to GH Pages 
10495    steps :
10596      - name : Determine GitHub Pages directory name 
10697        id : branch_dir_name 
@@ -114,21 +105,31 @@ jobs:
114105        with :
115106          name : build 
116107          path : packages 
117-       - name : Deploy ${{ matrix.package }} testing playground to GitHub Pages 
108+       - name : Prepare playgrounds for GH Pages 
109+         working-directory : ./packages 
110+         run : | 
111+           mkdir -p ../pages/ 
112+           for pkg in *; do 
113+             if [ -d "${pkg}/playground" ]; then 
114+               # using symlinks is quick and artifact generation will dereference them 
115+               # if the GH Pages action stops dereferencing these links, we'll need to copy the files instead 
116+               ln -s "../packages/${pkg}/playground" "../pages/${pkg}" 
117+             fi 
118+           done 
119+           ls -l ../pages/ 
120+        - name : Deploy playgrounds to GitHub Pages 
118121        uses : peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e  #  v4
119122        with :
120123          github_token : ${{ secrets.GITHUB_TOKEN }} 
121-           publish_dir : ./packages/${{ matrix.package }}/playground  
122-           destination_dir : " ${{steps.branch_dir_name.outputs.result}}/${{ matrix.package }} " 
124+           publish_dir : ./pages  
125+           destination_dir : " ${{steps.branch_dir_name.outputs.result}}" 
123126          full_commit_message : " Build for ${{ github.sha }} ${{ github.event.head_commit.message }}" 
124127
125128  results :
126-     name : Results 
129+     name : Test  Results
127130    runs-on : ubuntu-latest 
128-     needs :
129-       - test 
130-       - preview 
131-     if : ${{ always() }} 
131+     needs : test 
132+     if : ${{ !cancelled() }} 
132133    steps :
133134      - run : | 
134135          case "${{ needs.test.result }}" in 
@@ -146,19 +147,3 @@ jobs:
146147              exit 1 
147148              ;; 
148149          esac 
149-        - run : | 
150-           case "${{ needs.preview.result }}" in 
151-             success) 
152-               echo "GitHub Pages previews published successfully." 
153-               exit 0 
154-               ;; 
155-             skipped) 
156-               echo "Previews were unnecessary for these changes, so they were skipped." 
157-               echo "If this is unexpected, check the path filters." 
158-               exit 0 
159-               ;; 
160-             *) 
161-               echo "Publishing GitHub Pages previews failed." 
162-               exit 1 
163-               ;; 
164-           esac 
0 commit comments