From 23538cdc9836f929d1192bbd0605a6943a0e8c39 Mon Sep 17 00:00:00 2001 From: japborst Date: Mon, 3 Oct 2022 17:39:19 +0200 Subject: [PATCH 1/6] Align GHA and local setup for building the EPS website --- .github/workflows/deploy-website.yaml | 18 ++++++++++-------- website/.ruby-version | 1 + website/Gemfile | 9 ++++++--- website/README.md | 21 +++++++++++++++++++++ website/_config.yml | 7 +------ 5 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 website/.ruby-version diff --git a/.github/workflows/deploy-website.yaml b/.github/workflows/deploy-website.yaml index 4577fbdaac..c2fd51b20a 100644 --- a/.github/workflows/deploy-website.yaml +++ b/.github/workflows/deploy-website.yaml @@ -16,22 +16,24 @@ jobs: steps: - name: Check out code uses: actions/checkout@v3.1.0 + - uses: ruby/setup-ruby@v1.117.0 # Ruby version set in `.ruby-version`. + with: + working-directory: ./website + bundler-cache: true # Runs `bundle install` and caches installed gems automatically. - name: Configure Github Pages uses: actions/configure-pages@v2.1.1 - name: Generate documentation run: ./generate-docs.sh - name: Build website with Jekyll - uses: actions/jekyll-build-pages@v1.0.5 - with: - source: website/ - destination: ./_site + working-directory: ./website + run: bundle exec jekyll build - name: Validate HTML output - uses: anishathalye/proof-html@v1.4.1 - with: - directory: ./_site - check_external_hash: false + working-directory: ./website + run: bundle exec htmlproofer --check-external-hash false ./_site - name: Upload website as artifact uses: actions/upload-pages-artifact@v1.0.4 + with: + path: ./website/_site deploy: if: github.ref == 'refs/heads/master' needs: build diff --git a/website/.ruby-version b/website/.ruby-version new file mode 100644 index 0000000000..ef538c2810 --- /dev/null +++ b/website/.ruby-version @@ -0,0 +1 @@ +3.1.2 diff --git a/website/Gemfile b/website/Gemfile index cdeed141c6..734e7a144a 100644 --- a/website/Gemfile +++ b/website/Gemfile @@ -1,5 +1,8 @@ +ruby File.read(".ruby-version").strip + source "https://rubygems.org" -gem "github-pages", "227" gem "html-proofer", "4.4.1" -gem "jekyll-remote-theme", "0.4.3" -gem "rake", "13.0.6" +gem "jekyll", "4.2.2" +gem "jekyll-sitemap", "1.4" +gem "just-the-docs", "0.4.0.rc2" +gem "webrick", "1.7" diff --git a/website/README.md b/website/README.md index b1d8674559..19a720d8e0 100644 --- a/website/README.md +++ b/website/README.md @@ -24,6 +24,26 @@ If you are not familiar with Jekyll, be sure to check out its [documentation][jekyll-docs]. It is recommended to follow the provided step-by-step tutorial. +**Switch Ruby versions** + +The required Ruby version is set in `.ruby-version`. To switch, you can use +[rvm][rvm] to manage your Ruby version. + +**Resolve bundle issues** + +You may get a similar error when running `bundle install`: + +```sh +fatal error: 'openssl/ssl.h' file not found +``` + +In that case, run + +```sh +bundle config build.eventmachine --with-cppflags=-I$(brew --prefix openssl)/include +bundle install +``` + # Deployment The website is regenerated and deployed using the @@ -36,3 +56,4 @@ Actions workflow any time a change is merged to `master`. [jekyll-docs]: https://jekyllrb.com/docs/ [jekyll-docs-installation]: https://jekyllrb.com/docs/installation/ [localhost-port-4000]: http://127.0.0.1:4000 +[rvm]: https://rvm.io/ diff --git a/website/_config.yml b/website/_config.yml index 002a30563d..4c5f1303e1 100644 --- a/website/_config.yml +++ b/website/_config.yml @@ -6,13 +6,8 @@ description: >- Error Prone extensions: extra bug checkers and a large battery of Refaster templates. -# XXX: Investigate dropping the remote theme by instead managing just-the-docs -# using Bundler. This requires changes to the build setup. The upshot is that -# local and CI build environments would then be in sync. -# https://github.com/PicnicSupermarket/error-prone-support/pull/253#discussion_r982709523 -remote_theme: just-the-docs/just-the-docs@v0.4.0.rc2 +theme: just-the-docs plugins: - - jekyll-remote-theme - jekyll-sitemap # Files and directories not to be deployed through GitHub pages. From 26797059778145f3ed07c7fe2127da798bd8fe22 Mon Sep 17 00:00:00 2001 From: japborst Date: Tue, 4 Oct 2022 09:18:18 +0200 Subject: [PATCH 2/6] Fix spelling mistake --- generate-docs.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generate-docs.sh b/generate-docs.sh index 0eaa911ee2..1caf0f3d64 100755 --- a/generate-docs.sh +++ b/generate-docs.sh @@ -2,14 +2,14 @@ set -e -u -o pipefail -REPOSIORY_ROOT="$(git rev-parse --show-toplevel)" -WEBSITE_ROOT="${REPOSIORY_ROOT}/website" +REPOSITORY_ROOT="$(git rev-parse --show-toplevel)" +WEBSITE_ROOT="${REPOSITORY_ROOT}/website" generate_homepage() { local homepage="${WEBSITE_ROOT}/index.md" echo "Generating ${homepage}..." - cat - "${REPOSIORY_ROOT}/README.md" > "${homepage}" << EOF + cat - "${REPOSITORY_ROOT}/README.md" > "${homepage}" << EOF --- layout: default title: Home From 8c1bdd832ad71fcc7f6bf477d2c79cdd2c47357f Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Fri, 7 Oct 2022 08:15:48 +0200 Subject: [PATCH 3/6] Suggestions --- .github/workflows/deploy-website.yaml | 4 ++-- website/README.md | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-website.yaml b/.github/workflows/deploy-website.yaml index c2fd51b20a..0ea6e7dac5 100644 --- a/.github/workflows/deploy-website.yaml +++ b/.github/workflows/deploy-website.yaml @@ -16,10 +16,10 @@ jobs: steps: - name: Check out code uses: actions/checkout@v3.1.0 - - uses: ruby/setup-ruby@v1.117.0 # Ruby version set in `.ruby-version`. + - uses: ruby/setup-ruby@v1.117.0 with: working-directory: ./website - bundler-cache: true # Runs `bundle install` and caches installed gems automatically. + bundler-cache: true - name: Configure Github Pages uses: actions/configure-pages@v2.1.1 - name: Generate documentation diff --git a/website/README.md b/website/README.md index 19a720d8e0..cbf0782ac4 100644 --- a/website/README.md +++ b/website/README.md @@ -24,14 +24,14 @@ If you are not familiar with Jekyll, be sure to check out its [documentation][jekyll-docs]. It is recommended to follow the provided step-by-step tutorial. -**Switch Ruby versions** +###### Switching Ruby versions The required Ruby version is set in `.ruby-version`. To switch, you can use [rvm][rvm] to manage your Ruby version. -**Resolve bundle issues** +###### Resolving Bundler issues -You may get a similar error when running `bundle install`: +On Macos you may get an error such as th following when `bundle install`: ```sh fatal error: 'openssl/ssl.h' file not found @@ -40,7 +40,7 @@ fatal error: 'openssl/ssl.h' file not found In that case, run ```sh -bundle config build.eventmachine --with-cppflags=-I$(brew --prefix openssl)/include +bundle config build.eventmachine --with-cppflags="-I$(brew --prefix openssl)/include" bundle install ``` @@ -56,4 +56,4 @@ Actions workflow any time a change is merged to `master`. [jekyll-docs]: https://jekyllrb.com/docs/ [jekyll-docs-installation]: https://jekyllrb.com/docs/installation/ [localhost-port-4000]: http://127.0.0.1:4000 -[rvm]: https://rvm.io/ +[rvm]: https://rvm.io From 003c42a3df61057c4b924d56e4bb0621fc67165c Mon Sep 17 00:00:00 2001 From: japborst Date: Fri, 7 Oct 2022 16:26:50 +0200 Subject: [PATCH 4/6] Tweaks --- website/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/README.md b/website/README.md index cbf0782ac4..9dedaad528 100644 --- a/website/README.md +++ b/website/README.md @@ -31,7 +31,7 @@ The required Ruby version is set in `.ruby-version`. To switch, you can use ###### Resolving Bundler issues -On Macos you may get an error such as th following when `bundle install`: +On Macos you may get an error such as the following when `bundle install`: ```sh fatal error: 'openssl/ssl.h' file not found @@ -53,7 +53,7 @@ Actions workflow any time a change is merged to `master`. [error-prone-support-website]: https://error-prone.picnic.tech [error-prone-support-website-deploy-workflow]: https://github.com/PicnicSupermarket/error-prone-support/actions/workflows/deploy-website.yaml [jekyll]: https://jekyllrb.com -[jekyll-docs]: https://jekyllrb.com/docs/ -[jekyll-docs-installation]: https://jekyllrb.com/docs/installation/ +[jekyll-docs]: https://jekyllrb.com/docs +[jekyll-docs-installation]: https://jekyllrb.com/docs/installation [localhost-port-4000]: http://127.0.0.1:4000 [rvm]: https://rvm.io From 79485bb91f65dd41ed9c1f1bd9d3de1a5614dc77 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Sun, 9 Oct 2022 18:39:26 +0200 Subject: [PATCH 5/6] Suggestions --- website/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/README.md b/website/README.md index 9dedaad528..92bbeba149 100644 --- a/website/README.md +++ b/website/README.md @@ -31,13 +31,14 @@ The required Ruby version is set in `.ruby-version`. To switch, you can use ###### Resolving Bundler issues -On Macos you may get an error such as the following when `bundle install`: +On macOS, you may get an error such as the following when running `bundle +install`: ```sh fatal error: 'openssl/ssl.h' file not found ``` -In that case, run +In that case, run: ```sh bundle config build.eventmachine --with-cppflags="-I$(brew --prefix openssl)/include" From 83f8cf871f6920c36c411cb0bd3477d9dd5e302c Mon Sep 17 00:00:00 2001 From: japborst Date: Sun, 9 Oct 2022 19:39:16 +0200 Subject: [PATCH 6/6] Tweaks --- website/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/README.md b/website/README.md index 92bbeba149..b9d0f9833a 100644 --- a/website/README.md +++ b/website/README.md @@ -24,12 +24,12 @@ If you are not familiar with Jekyll, be sure to check out its [documentation][jekyll-docs]. It is recommended to follow the provided step-by-step tutorial. -###### Switching Ruby versions +###### Switch Ruby versions The required Ruby version is set in `.ruby-version`. To switch, you can use [rvm][rvm] to manage your Ruby version. -###### Resolving Bundler issues +###### Resolve Bundler issues On macOS, you may get an error such as the following when running `bundle install`: