Skip to content

Commit bc4e54d

Browse files
committed
Add docs deployment to npm-lib-release
Signed-off-by: Alex Lourie <alex.lourie@zepben.com>
1 parent 6e42d41 commit bc4e54d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/npm-lib-release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
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' }}

0 commit comments

Comments
 (0)