Skip to content

Commit

Permalink
Align GHA and local setup for building the EPS website
Browse files Browse the repository at this point in the history
  • Loading branch information
japborst committed Oct 3, 2022
1 parent 1b5220a commit be8d24c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 18 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/deploy-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Update `error-prone.picnic.tech` website content
on:
pull_request:
push:
branches: [$default-branch]
branches:
- $default-branch]
- japborst/local-builds
permissions:
contents: read
pages: write
Expand All @@ -16,22 +18,24 @@ jobs:
steps:
- name: Check out code
uses: actions/[email protected]
- uses: ruby/[email protected] # 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/[email protected]
- name: Generate documentation
run: ./generate-docs.sh
- name: Build website with Jekyll
uses: actions/[email protected]
with:
source: website/
destination: ./_site
working-directory: ./website
run: bundle exec jekyll build
- name: Validate HTML output
uses: anishathalye/[email protected]
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/[email protected]
with:
path: ./website/_site
deploy:
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
needs: build
Expand Down
1 change: 1 addition & 0 deletions website/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.2
9 changes: 6 additions & 3 deletions website/Gemfile
Original file line number Diff line number Diff line change
@@ -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"
21 changes: 21 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/
7 changes: 1 addition & 6 deletions website/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ description: >-
Error Prone extensions: extra bug checkers and a large battery of Refaster
templates.
# XXX: Invesigate 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/[email protected]
theme: just-the-docs
plugins:
- jekyll-remote-theme
- jekyll-sitemap

# Files and directories not to be deployed through GitHub pages.
Expand Down

0 comments on commit be8d24c

Please sign in to comment.