Skip to content

Commit 9e84c05

Browse files
committed
Fix Jekyll build workflow for Just the Docs theme
- Use Ruby setup with bundler for proper gem installation - Install just-the-docs gem directly - Build from docs folder - Use theme: instead of remote_theme:
1 parent c3aa882 commit 9e84c05

2 files changed

Lines changed: 41 additions & 16 deletions

File tree

.github/workflows/jekyll-gh-pages.yml

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,70 @@
1-
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2-
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
1+
# Build and deploy Jekyll site with Just the Docs theme to GitHub Pages
2+
name: Deploy Documentation
33

44
on:
5-
# Runs on pushes targeting the default branch
65
push:
76
branches: ["main"]
8-
9-
# Allows you to run this workflow manually from the Actions tab
7+
paths:
8+
- 'docs/**'
9+
- '.github/workflows/jekyll-gh-pages.yml'
1010
workflow_dispatch:
1111

12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1312
permissions:
1413
contents: read
1514
pages: write
1615
id-token: write
1716

18-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2017
concurrency:
2118
group: "pages"
2219
cancel-in-progress: false
2320

2421
jobs:
25-
# Build job
2622
build:
2723
runs-on: ubuntu-latest
2824
steps:
2925
- name: Checkout
3026
uses: actions/checkout@v4
27+
28+
- name: Setup Ruby
29+
uses: ruby/setup-ruby@v1
30+
with:
31+
ruby-version: '3.2'
32+
bundler-cache: true
33+
working-directory: docs
34+
35+
- name: Create Gemfile
36+
run: |
37+
cd docs
38+
cat > Gemfile << 'EOF'
39+
source "https://rubygems.org"
40+
gem "jekyll", "~> 4.3"
41+
gem "just-the-docs", "~> 0.10.1"
42+
gem "jekyll-seo-tag"
43+
gem "jekyll-sitemap"
44+
gem "jekyll-relative-links"
45+
EOF
46+
47+
- name: Install dependencies
48+
run: |
49+
cd docs
50+
bundle install
51+
3152
- name: Setup Pages
53+
id: pages
3254
uses: actions/configure-pages@v5
55+
3356
- name: Build with Jekyll
34-
uses: actions/jekyll-build-pages@v1
35-
with:
36-
source: ./
37-
destination: ./_site
57+
run: |
58+
cd docs
59+
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
60+
env:
61+
JEKYLL_ENV: production
62+
3863
- name: Upload artifact
3964
uses: actions/upload-pages-artifact@v3
65+
with:
66+
path: docs/_site
4067

41-
# Deployment job
4268
deploy:
4369
environment:
4470
name: github-pages

docs/_config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ url: "https://aws-samples.github.io"
1010
repository: aws-samples/sample-bedrock-agentcore-gateway-user-federation
1111

1212
# Theme - Just the Docs for left navigation
13-
remote_theme: just-the-docs/just-the-docs@v0.10.1
13+
theme: just-the-docs
1414
color_scheme: light
1515

1616
# Plugins
1717
plugins:
18-
- jekyll-remote-theme
1918
- jekyll-seo-tag
2019
- jekyll-sitemap
2120
- jekyll-relative-links

0 commit comments

Comments
 (0)