-
Notifications
You must be signed in to change notification settings - Fork 27
42 lines (34 loc) · 1.05 KB
/
build-and-deploy.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
37
38
39
40
41
name: Build and Deploy
on:
push:
branches:
- master
workflow_dispatch:
# This is just a guard against two of these actions
# running at the same time. Not likely an issue for
# us right now, but it could happen.
concurrency: build-and-deploy-${{ github.ref }}
jobs:
check-for-doc-changes:
runs-on: ubuntu-latest
steps:
- name: Check for changes in docs folder
id: docs_check
run: |
if git diff --quiet HEAD^ HEAD --name-only | grep -q '^docs/'; then
echo "::set-output name=docs_changed::true"
else
echo "::set-output name=docs_changed::false"
fi
deploy-docs:
runs-on: ubuntu-latest
needs: check_docs_changes
if: needs.check-for-doc-changes.outputs.docs_changed == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy documentation
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs
branch: gh-pages # default for this action, but including to be explicit