Use another approach to use Jekyll without deprecated gh-pages jekyll gem

This commit is contained in:
Max 2024-03-27 01:17:45 +01:00 committed by GitHub
parent e2a3142e4e
commit 65c2d1b46d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.
@ -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
@ -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