File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9494 artifact : ${{ steps.build.outputs.artifact }}
9595 artifact-id : ${{ steps.build.outputs.artifact-id }}
9696 version : ${{ steps.build.outputs.version }}
97+ docs-present : ${{ steps.docs.outputs.present }}
9798 env :
9899 GITHUB_TOKEN : ${{ secrets.CI_GITHUB_TOKEN }}
99100 steps :
@@ -166,6 +167,30 @@ jobs:
166167 exit 1
167168 shell : sh
168169
170+ - name : Check if docs present
171+ id : docs
172+ run : |
173+ if [ -d docs ]; then
174+ echo "Docs folder found, will run the build-docs job"
175+ echo "present=yes" >> "${GITHUB_OUTPUT}"
176+ echo "present=yes" >> "${GITHUB_ENV}"
177+ else
178+ echo "Docs folder not found, will skip the build-docs"
179+ fi
180+
181+ - name : Check doc build artifacts are ignored
182+ if : ${{ env.present == 'yes' }}
183+ shell : sh {0}
184+ run : |
185+ # Make sure directories are properly ignored
186+ # docs/node_modules
187+ git check-ignore -q docs/site-config
188+ if [ $? != 0 ]; then
189+ echo "ERROR! Make sure to add 'docs/site-config' to .gitignore"
190+ echo "::error line=1::ERROR! Make sure to add 'docs/site-config' to .gitignore"
191+ exit 1
192+ fi
193+
169194 build-docs :
170195 needs : [build-artifact]
171196 if : ${{ needs.build-artifact.outputs.docs-present == 'yes' }}
You can’t perform that action at this time.
0 commit comments