Skip to content

Commit

Permalink
Tested on another example repository. Should work otherwise manual br…
Browse files Browse the repository at this point in the history
…anch deployment may be the easy method
  • Loading branch information
choafe committed May 16, 2024
1 parent 132c345 commit 48e0cc5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 20 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,63 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
name: Deploy Jekyll site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main", "newbie-guide"]
branches:
- "main"
- "newbie-guide"
paths: # Uncomment once website is running (only changes to docs should trigger workflow)
- "docs/**"

# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
workflow_dispatch: # UNCOMMENT once website is running (prevent random event triggers)

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

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

defaults:
run:
# Specifies where all site materials are located for the job
working-directory: ./docs
cancel-in-progress: true

jobs:
# Build job
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs/
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2" # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
working-directory: "${{ github.workspace }}/docs"
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
with:
path: "docs/_site/"

# Deployment job
deploy:
Expand Down
8 changes: 4 additions & 4 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ source "https://rubygems.org"
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.3.3"
# gem "jekyll", "~> 4.3.3"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
# gem "minima", "~> 2.5"

# This is the chosen theme for the newbie guide.
gem "just-the-docs"

# This resolves Ruby version issues since webrick is no longer bundled in Ruby 3.0.
# https://github.com/jekyll/jekyll/issues/8523
gem "webrick"

# This is the chosen theme for the newbie guide.
gem "just-the-docs"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins
Expand Down

0 comments on commit 48e0cc5

Please sign in to comment.