Skip to content

Commit 6863d9e

Browse files
authored
Enhance Jekyll LFS GitHub Pages workflow
Updated workflow to include additional comments and modify permissions for GITHUB_TOKEN.
1 parent 18bc983 commit 6863d9e

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

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

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# https://github.com/actions/starter-workflows/blob/main/pages/jekyll.yml
6+
17
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
28
name: Deploy LFS Jekyll to GitHub Pages
39

@@ -11,12 +17,12 @@ on:
1117

1218
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1319
permissions:
14-
contents: write
20+
contents: read
1521
pages: write
1622
id-token: write
1723

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.
24+
# Allow only one concurrent deployment,
25+
# skipping runs queued between the run in-progress and latest
2026
concurrency:
2127
group: "pages"
2228
cancel-in-progress: true
@@ -39,16 +45,26 @@ jobs:
3945
rm -Rf .git;
4046
rm .gitattributes;
4147
48+
- name: Setup Ruby
49+
# https://github.com/ruby/setup-ruby/releases/tag/v1.207.0
50+
uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4
51+
with:
52+
ruby-version: '3.1' # Not needed with a .ruby-version file
53+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
54+
cache-version: 0 # Increment this number if you need to re-download cached gems
55+
4256
- name: Setup Pages
57+
id: pages
4358
uses: actions/configure-pages@v5
4459

4560
- name: Build with Jekyll
46-
uses: actions/jekyll-build-pages@v1
47-
with:
48-
source: ./
49-
destination: ./_site
61+
# Outputs to the './_site' directory by default
62+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
63+
env:
64+
JEKYLL_ENV: production
5065

5166
- name: Upload artifact
67+
# Automatically uploads an artifact from the './_site' directory by default
5268
uses: actions/upload-pages-artifact@v3
5369

5470
# Deployment job

0 commit comments

Comments
 (0)