Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up documentation website generation and deployment #253

Merged
merged 28 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a2c547c
Bootstrap documentation website
japborst Sep 21, 2022
1d73f70
Add Picnic logo; small improvements
japborst Sep 21, 2022
0d95718
A few SEO improvements
japborst Sep 24, 2022
964ec64
Use absolute path for Picnic logo
japborst Sep 27, 2022
45f7703
Update `.gitignore`, fix typo, and sort links in README
rickie Sep 27, 2022
087f520
Tweaks
japborst Sep 27, 2022
378bfff
Store logo only in 1 place
japborst Sep 27, 2022
7d384f1
Update description
japborst Sep 28, 2022
1033164
Suggestions
rickie Sep 28, 2022
c9eae04
Tweaks
japborst Sep 28, 2022
e800d23
Drop `workflow_dispatch` from `build.yaml`
rickie Sep 29, 2022
2521fe5
Build sitemap.xml and robots.txt
japborst Sep 30, 2022
f62b632
Fix invalid urls and move favicon to the root
japborst Oct 1, 2022
8b1f2ab
Introduce html-proofer
japborst Oct 1, 2022
4ba8dd2
Build on every PR, deploy on default branch
japborst Oct 2, 2022
471bb6f
Attempt to fix deployment step
japborst Oct 2, 2022
9890367
Attempt to fix deploy conditional
japborst Oct 2, 2022
a0619f6
Attempt to force checking html
japborst Oct 2, 2022
e2adb4a
Use other proofer action
japborst Oct 2, 2022
d295e60
Suggestions
Stephan202 Oct 2, 2022
aa045b5
Suggestion
Stephan202 Oct 2, 2022
67e2f07
Tweaks
japborst Oct 2, 2022
ed33906
Use remote theme
japborst Oct 2, 2022
baee39a
Tweaks
japborst Oct 2, 2022
db0dc5d
Update local dev setup for remote themes
japborst Oct 2, 2022
1b5220a
Suggestions
Stephan202 Oct 3, 2022
ade5782
Suggestions
rickie Oct 3, 2022
5a0c65e
Suggestions
Stephan202 Oct 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/deploy-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
pages: write
id-token: write
concurrency:
group: "pages"
group: pages
cancel-in-progress: true
jobs:
build:
Expand All @@ -19,13 +19,13 @@ jobs:
- name: Configure Github Pages
uses: actions/configure-pages@v2.1.1
- name: Generate documentation
run: bash ./generate-docs.sh
run: ./generate-docs.sh
- name: Build website with Jekyll
uses: actions/jekyll-build-pages@v1.0.5
with:
source: website/
destination: ./_site
- name: Validating HTML output
- name: Validate HTML output
uses: anishathalye/proof-html@v1.4.1
with:
directory: ./_site
Expand All @@ -34,11 +34,11 @@ jobs:
uses: actions/upload-pages-artifact@v1.0.4
deploy:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be clearer to have a newline between these two parts.

Copy link
Member Author

@japborst japborst Sep 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation already takes care of that. We also don't do that above, or in build.yaml.

if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
needs: build
runs-on: ubuntu-22.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
2 changes: 2 additions & 0 deletions generate-docs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll push some suggestions for this file. (Not relying on the side-effect of cd, addressing shellcheck output, etc.)


set -e -u -o pipefail

WEBSITE_FOLDER="website"
HOMEPAGE="${WEBSITE_FOLDER}/index.md"

Expand Down
14 changes: 6 additions & 8 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
### Jekyll ###
_site/
.sass-cache/
# Generated by Bundler and Jekyll.
.bundle/
Gemfile.lock
.jekyll-cache/
.jekyll-metadata
Gemfile.lock

# Ignore folders generated by Bundler
.bundle/
.sass-cache/
_site/
vendor/

# Generated content
# Generated by `../generate-docs.sh`.
*.bak
index.md
7 changes: 3 additions & 4 deletions website/Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
source "https://rubygems.org"
gem "github-pages", "~> 227"
gem "rake", "~> 13.0" # Required for "just-the-docs" theme.
gem "jekyll-sitemap", "~> 1.4"
gem "html-proofer", "~> 4.4"
gem "github-pages", "227"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also fix the Ruby version used? See https://bundler.io/guides/gemfile_ruby.html#specifying-a-ruby-version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to make part of the larger initiative, see #253 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't read all of the comments so was just a drive-by comment. SGTM 👍

gem "html-proofer", "4.4.1"
gem "just-the-docs", "0.4.0.rc2"
14 changes: 4 additions & 10 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ bundle install
```

The website will now be [available][localhost-port-4000] on port 4000. Source
code modifications will automatically be reflected. (An exception is
`_config.yml`: changes to this file require a server restart.) Subsequent
server restarts do not require running `bundle install`, unless `Gemfile` has
been updated in the interim.

Documentation can be regenerated whist jekyll is running, by executing:

```sh
../generate-docs.sh
```
code modifications (including the result of rerunning `../generate-docs.sh`)
will automatically be reflected. (An exception is `_config.yml`: changes to
this file require a server restart.) Subsequent server restarts do not require
running `bundle install`, unless `Gemfile` has been updated in the interim.

If you are not familiar with Jekyll, be sure to check out its
[documentation][jekyll-docs]. It is recommended to follow the provided
Expand Down
27 changes: 12 additions & 15 deletions website/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,36 @@ title: Error Prone Support
logo: assets/images/favicon.svg
url: https://error-prone.picnic.tech
description: >-
japborst marked this conversation as resolved.
Show resolved Hide resolved
Error Prone extensions: extra bug checkers and a large battery of Refaster templates.
Error Prone extensions: extra bug checkers and a large battery of Refaster
templates.

remote_theme: just-the-docs/just-the-docs
theme: just-the-docs
plugins:
- jekyll-remote-theme
- jekyll-sitemap
- jekyll-sitemap

# Do not deploy these files and folders through GitHub pages.
# Files and directories not to be deployed through GitHub pages.
exclude:
- Gemfile
- Gemfile.lock
- README.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add vendor here because I got an issue while generating. Related GH thread.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting... I did not have that issue 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have this issue either. And I also don't see the .bundle and vendor directories mentioned in the .gitignore 🤔

- vendor

permalink: pretty # Use /doc/ instead of /doc.html.

# Theme configuration.
search_enabled: true
heading_anchors: true
# See https://jekyllrb.com/docs/permalinks/#built-in-formats.
permalink: pretty

# See https://just-the-docs.github.io/just-the-docs/docs/navigation-structure/#external-navigation-links.
nav_external_links:
- title: Error Prone Support on GitHub
url: https://github.com/PicnicSupermarket/error-prone-support
hide_icon: false

# Author configuration.
twitter:
username: picnic
card: summary

# See https://jekyll.github.io/jekyll-seo-tag/usage/.
social:
name: Picnic
links:
- https://github.com/PicnicSupermarket
- https://twitter.com/picnic
- https://www.linkedin.com/company/picnictechnologies
twitter:
username: picnic
card: summary
1 change: 1 addition & 0 deletions website/_sass/custom/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
vertical-align: text-bottom;
}

// Center and shrink the footer logo.
japborst marked this conversation as resolved.
Show resolved Hide resolved
footer > img#logo {
width: 2rem;
margin: 0 auto;
Expand Down