From de7a312aaba5090df555de6ce3793dfa1508aec4 Mon Sep 17 00:00:00 2001 From: Max Korbel Date: Mon, 6 Jan 2025 12:02:02 -0800 Subject: [PATCH] Fix `jekyll` build checks to match actual deployment, constrain version (#79) --- .github/workflows/general.yml | 6 +----- .github/workflows/jekyll.yml | 14 ++++++++++---- docs/.ruby-version | 1 + docs/Gemfile | 2 ++ 4 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 docs/.ruby-version diff --git a/.github/workflows/general.yml b/.github/workflows/general.yml index d00a74e..56dcc56 100644 --- a/.github/workflows/general.yml +++ b/.github/workflows/general.yml @@ -30,8 +30,4 @@ jobs: with: use-quiet-mode: yes # output is too noisy, see https://github.com/gaurav-nelson/github-action-markdown-link-check/issues/121 config-file: .github/configs/mlc_config.json - - - uses: PaulRosenthal/Jekyll-Deploy-Test-Action@v3 - with: - gemfile-location: '/docs' - site-directory: '/docs' + \ No newline at end of file diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index 5660a05..6298c0a 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -3,13 +3,15 @@ # separate terms of service, privacy policy, and support # documentation. -# Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Jekyll site to Pages +# Workflow for building and deploying a Jekyll site to GitHub Pages +name: Build and Deploy Jekyll site to Pages on: # Runs on pushes targeting the default branch push: branches: ["main"] + pull_request: + branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -34,9 +36,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Ruby - uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0 + uses: ruby/setup-ruby@v1 with: - ruby-version: '3.1' # Not needed with a .ruby-version file + ruby-version: '3.1' # Not needed with a .ruby-version file, but putting since the file is range + working-directory: docs 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 - name: Setup Pages @@ -58,6 +61,9 @@ jobs: # Deployment job deploy: + # only deploy when it's merged into the main branch + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/docs/.ruby-version b/docs/.ruby-version new file mode 100644 index 0000000..4af7dfe --- /dev/null +++ b/docs/.ruby-version @@ -0,0 +1 @@ +>= 3.0 \ No newline at end of file diff --git a/docs/Gemfile b/docs/Gemfile index e4fc281..ef9b8e9 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,4 +1,6 @@ source "https://rubygems.org" +ruby file: ".ruby-version" + gem "jekyll", "~> 4.3.4" gem "minimal-mistakes-jekyll"