-
-
Notifications
You must be signed in to change notification settings - Fork 604
36 lines (31 loc) · 1.01 KB
/
netlify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Deploy documentation to Netlify
on:
push:
branches:
- main
jobs:
check-docs-changes:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Check if /docs/ has changes
id: check_docs
run: |
changes=$(git diff --name-only HEAD~1 HEAD | grep '^docs/' || true)
if [ -z "$changes" ]; then
echo "No changes in /docs/. Skipping deployment."
echo "deploy=false" >> $GITHUB_OUTPUT
else
echo "Changes detected in /docs/. Proceeding with deployment."
echo "deploy=true" >> $GITHUB_OUTPUT
fi
- name: Deploy to Netlify
if: steps.check_docs.outputs.deploy == 'true'
env:
NETLIFY_BUILD_HOOK_URL: ${{ secrets.NETLIFY_BUILD_HOOK_URL }}
run: |
curl -X POST -d {} -H "Content-Type: application/json" $NETLIFY_BUILD_HOOK_URL
continue-on-error: true