Skip to content

Commit

Permalink
Generate docs before deploying to GH pages
Browse files Browse the repository at this point in the history
  • Loading branch information
japborst committed Sep 21, 2022
1 parent 2fecc98 commit 49c4efb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
uses: actions/[email protected]
- name: Configure Github Pages
uses: actions/[email protected]
- name: Generate documentation
run: bash ./generate-docs.sh
- name: Build website with Jekyll
uses: actions/[email protected]
with:
Expand Down
7 changes: 7 additions & 0 deletions generate-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ REFASTER_DOCS_FOLDER="${DOCS_FOLDER}/refastertemplates"

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

configure() {
cd "$(git rev-parse --show-toplevel || echo .)"
mkdir "${BUGPATTERN_FOLDER}" 2>/dev/null
mkdir "${REFASTER_FOLDER}" 2>/dev/null
}

generate_homepage() {
echo "Generating ${HOMEPAGE}"
cat > "${HOMEPAGE}" << EOF
Expand Down Expand Up @@ -112,6 +118,7 @@ EOF
}

# Do it
configure
generate_homepage
generate_bugpattern_docs
generate_refaster_docs
6 changes: 6 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Jekyll generated files
Gemfile.lock
.sass-cache
_site/

# Generated content
index.md
bugpatterns/
refastertemplates/
10 changes: 8 additions & 2 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Error Prone Support website

This directory contains the majority of the source code that powers
[error-prone.picnic.tech][https://error-prone.picnic.tech/]. The website is
[error-prone.picnic.tech][error-prone-support-website]. The website is
statically generated using [Jekyll][jekyll].

# Local development
Expand All @@ -11,7 +11,7 @@ instructions][jekyll-docs-installation]. Once done, in this directory execute:

```sh
bundle install
bundle exec jekyll serve --livereload
../generate-docs.sh && bundle exec jekyll serve --livereload
```

The website will now be [available][localhost-port-4000] on port 4000. Source
Expand All @@ -20,6 +20,12 @@ code modifications will automatically be reflected. (An exception is
server restarts do not require running `bundle install`, unless `Gemfile` has
been updated in the interim.

Documentation can be re-generated whist jekyll is running, by executing:

```sh
../generate-docs.sh
```

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.
Expand Down

0 comments on commit 49c4efb

Please sign in to comment.