Skip to content

Commit

Permalink
Use another approach to use Jekyll without deprecated gh-pages jekyll…
Browse files Browse the repository at this point in the history
… gem
  • Loading branch information
MG-5 authored Mar 27, 2024
1 parent e2a3142 commit 65c2d1b
Showing 1 changed file with 37 additions and 11 deletions.
48 changes: 37 additions & 11 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ on:
# 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.
Expand All @@ -24,6 +22,11 @@ concurrency:
jobs:
# Build job
build:
name: "Build GitHub Pages Site"

permissions:
contents: read

runs-on: ubuntu-latest
steps:
- name: Cached checkout
Expand All @@ -32,24 +35,47 @@ jobs:
# with:
# include: "*"
# exclude: ""
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1

- name: "Setup Ruby"
uses: ruby/setup-ruby@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
bundler-cache: true
cache-version: 0 # Increment this number if you need to re-download cached gems.

- name: "Setup Pages"
id: pages
uses: actions/configure-pages@v4

- name: "Build with Jekyll"
run: bundle exec jekyll build --trace --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production

- name: "Upload artifact"
uses: actions/upload-pages-artifact@v3
with:
path: _site/

# Deployment job

deploy:
name: "Deploy GitHub Pages Site"
if: github.event_name == 'push'
needs:
- build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
- name: "Deploy to GitHub Pages"
id: deployment
uses: actions/deploy-pages@v4
with:
error_count: 0

0 comments on commit 65c2d1b

Please sign in to comment.