89
89
90
90
preview :
91
91
runs-on : ubuntu-latest
92
- needs :
93
- - build
94
- - test
92
+ needs : build
95
93
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
104
95
steps :
105
96
- name : Determine GitHub Pages directory name
106
97
id : branch_dir_name
@@ -114,21 +105,29 @@ jobs:
114
105
with :
115
106
name : build
116
107
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
+ ln -s "../packages/${pkg}/playground" "../pages/${pkg}"
115
+ fi
116
+ done
117
+ ls -l ../pages/
118
+ - name : Deploy playgrounds to GitHub Pages
118
119
uses : peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
119
120
with :
120
121
github_token : ${{ secrets.GITHUB_TOKEN }}
121
- publish_dir : ./packages/${{ matrix.package }}/playground
122
- destination_dir : " ${{steps.branch_dir_name.outputs.result}}/${{ matrix.package }} "
122
+ publish_dir : ./pages
123
+ destination_dir : " ${{steps.branch_dir_name.outputs.result}}"
123
124
full_commit_message : " Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
124
125
125
126
results :
126
- name : Results
127
+ name : Test Results
127
128
runs-on : ubuntu-latest
128
- needs :
129
- - test
130
- - preview
131
- if : ${{ always() }}
129
+ needs : test
130
+ if : ${{ !cancelled() }}
132
131
steps :
133
132
- run : |
134
133
case "${{ needs.test.result }}" in
@@ -146,19 +145,3 @@ jobs:
146
145
exit 1
147
146
;;
148
147
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