Skip to content

Commit 2b45660

Browse files
committed
only deploy docs on updates
1 parent 6b4de9d commit 2b45660

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and Deploy Jekyll Site from /docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**' # This correctly triggers the workflow only when docs changes
9+
workflow_dispatch:
10+
11+
jobs:
12+
build_and_deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Ruby
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: '2.7.1' # Or your Jekyll's required Ruby version
22+
bundler-cache: true
23+
# Set the cache path to be relative to the docs directory
24+
cache-version: 1
25+
working-directory: './docs'
26+
27+
- name: Build the site
28+
# This command now runs inside the ./docs directory
29+
run: bundle exec jekyll build
30+
working-directory: ./docs
31+
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
# The publish directory is now ./docs/_site
37+
publish_dir: ./docs/_site

0 commit comments

Comments
 (0)