Skip to content

Commit 3749e00

Browse files
authored
Update jekyll-gh-pages.yml
1 parent 4188eb6 commit 3749e00

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

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

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
1+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2+
name: Deploy Jekyll site to Pages
23

34
on:
4-
# Runs on pushes targeting the default branch
55
push:
6-
branches: ["main"]
6+
branches:
7+
- "main"
8+
paths:
9+
- "docs/**"
710

811
# Allows you to run this workflow manually from the Actions tab
912
workflow_dispatch:
@@ -14,28 +17,41 @@ permissions:
1417
pages: write
1518
id-token: write
1619

17-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
# Allow one concurrent deployment
1921
concurrency:
2022
group: "pages"
21-
cancel-in-progress: false
23+
cancel-in-progress: true
2224

2325
jobs:
2426
# Build job
2527
build:
2628
runs-on: ubuntu-latest
29+
defaults:
30+
run:
31+
working-directory: docs
2732
steps:
2833
- name: Checkout
2934
uses: actions/checkout@v4
35+
- name: Setup Ruby
36+
uses: ruby/setup-ruby@v1
37+
with:
38+
ruby-version: '3.3' # Not needed with a .ruby-version file
39+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
40+
cache-version: 0 # Increment this number if you need to re-download cached gems
41+
working-directory: '${{ github.workspace }}/docs'
3042
- name: Setup Pages
43+
id: pages
3144
uses: actions/configure-pages@v5
3245
- name: Build with Jekyll
33-
uses: actions/jekyll-build-pages@v1
34-
with:
35-
source: ./docs
36-
destination: ./_site
46+
# Outputs to the './_site' directory by default
47+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
48+
env:
49+
JEKYLL_ENV: production
3750
- name: Upload artifact
51+
# Automatically uploads an artifact from the './_site' directory by default
3852
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: docs/_site/
3955

4056
# Deployment job
4157
deploy:

0 commit comments

Comments
 (0)