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

Creating the NewHelp site with a default Jekyll installation #49628

Merged
merged 26 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f87cbac
First commit for NewHelp
quinthar Sep 23, 2024
bf2b7f9
Configured Jekyll action and build steps
quinthar Sep 24, 2024
288ccae
Slight updates from review
quinthar Sep 25, 2024
903aedf
Undoing suggested fix to see if it fixees worse syntax error
quinthar Sep 25, 2024
2b4f0d2
Added basic superapp page
quinthar Sep 25, 2024
808d5a9
Updated for custom plugin for deep linking
quinthar Sep 25, 2024
a452a8e
Removed Github pages dependency to get plugins
quinthar Sep 25, 2024
304fdb5
Trying to fix build issues in github acitons
quinthar Sep 25, 2024
c208034
More attempted fixes
quinthar Sep 25, 2024
216ded6
Explicitly installing Jekyll
quinthar Sep 25, 2024
aeadd2a
Explicitly installing ffi
quinthar Sep 25, 2024
0cfd840
More fixes
quinthar Sep 25, 2024
ee36a05
Reverted a bunch, trying again with better directory control
quinthar Sep 27, 2024
d65098e
Reverted a bunch, trying again with better directory control
quinthar Sep 27, 2024
ce36bfb
Removing cruft
quinthar Sep 27, 2024
6393350
Still working on working directory
quinthar Sep 27, 2024
29656b5
Still working on working directory
quinthar Sep 27, 2024
f71e207
Still working on working directory
quinthar Sep 27, 2024
d158e6d
Still working on working directory
quinthar Sep 27, 2024
843e099
Fixing validation error
quinthar Sep 27, 2024
689b355
With amazing updates from @rory
quinthar Sep 27, 2024
a2598c4
Whoops, missed ruby-version file
quinthar Sep 27, 2024
93385fc
Removing working directory from Ruby install so it finds the .ruby-ve…
quinthar Sep 27, 2024
ec8e29e
Moving .ruby-version to /help to keep install all in there
quinthar Sep 27, 2024
99beb83
Removing main commit hook per @rory's suggestion
quinthar Sep 27, 2024
4c45ce3
Fixed working directory
quinthar Sep 27, 2024
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
68 changes: 68 additions & 0 deletions .github/workflows/deployNewHelp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on:
# Run on any push to main that has changes to the help directory
push:
branches:
- main
paths:
- 'help/**'

# Run on any pull request (except PRs against staging or production) that has changes to the docs directory
pull_request:
types: [opened, synchronize]
branches-ignore: [staging, production]
paths:
- 'help/**'

# Run on any manual trigger
workflow_dispatch:

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "newhelp"
cancel-in-progress: false

jobs:
build:
env:
IS_PR_FROM_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove fetch-depth: 0. We really only need the snapshot of the repo with the latest commit to run a build, not the full history of all branches and tags. Removing this will save us more than a minute on each workflow run.

Copy link
Contributor

Choose a reason for hiding this comment

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

bump on this change. It makes the workflow much faster and is documented as a best practice here: https://github.com/Expensify/App/blob/44d09e58e73e937ad60e1c26107bfc022f5e4674/.github/workflows/README.md#fast-fetch

fetch-depth: 0

- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1.0.13 # Using the latest stable version
with:
source: ./help/
destination: ./help/_site

- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1 # Using the latest stable version
id: deploy
if: env.IS_PR_FROM_FORK != 'true'
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: newhelp
directory: ./help/_site

- name: Setup Cloudflare CLI
if: env.IS_PR_FROM_FORK != 'true'
run: pip3 install cloudflare==2.19.0

- name: Purge Cloudflare cache
if: env.IS_PR_FROM_FORK != 'true'
run: $HOME/.local/bin/cli4 --verbose --delete hosts=["help.expensify.com"] /zones/:9ee042e6cfc7fd45e74aa7d2f78d617b/purge_cache
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh the linter is complaining about this line. It wants you to put double quotes around $HOME/.local/bin/cli4 to prevent word splittding on $HOME

env:
CF_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }}

- name: Leave a comment on the PR
uses: actions-cool/maintain-one-comment@v3.2.0 # Using the latest stable version
if: ${{ github.event_name == 'pull_request' && env.IS_PR_FROM_FORK != 'true' }}
with:
token: ${{ secrets.OS_BOTIFY_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

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

NAB but generally it's a best practice to just use the github.token unless you have a reason it needs to be OSBotify. The built-in token has higher rate limits

body: ${{ format('A preview of your New Help changes have been deployed to {0} :zap:️', steps.deploy.outputs.alias) }}

5 changes: 5 additions & 0 deletions help/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor
25 changes: 25 additions & 0 deletions help/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
permalink: /404.html
layout: default
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
33 changes: 33 additions & 0 deletions help/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.3.4"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
182 changes: 182 additions & 0 deletions help/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
bigdecimal (3.1.8)
colorator (1.1.0)
concurrent-ruby (1.3.4)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.17.0)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-aarch64-linux-musl)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm-linux-musl)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86-linux-musl)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
ffi (1.17.0-x86_64-linux-musl)
forwardable-extended (2.6.0)
google-protobuf (4.28.2)
bigdecimal
rake (>= 13)
google-protobuf (4.28.2-aarch64-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.28.2-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.28.2-x86-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.28.2-x86_64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.28.2-x86_64-linux)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
jekyll (4.3.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-feed (0.17.0)
jekyll (>= 3.7, < 5.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minima (2.5.2)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (6.0.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.3.7)
rouge (4.4.0)
safe_yaml (1.0.5)
sass-embedded (1.79.3)
google-protobuf (~> 4.27)
rake (>= 13)
sass-embedded (1.79.3-aarch64-linux-android)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-aarch64-linux-gnu)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-aarch64-linux-musl)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-aarch64-mingw-ucrt)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-arm-linux-androideabi)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-arm-linux-gnueabihf)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-arm-linux-musleabihf)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-arm64-darwin)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-riscv64-linux-android)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-riscv64-linux-gnu)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-riscv64-linux-musl)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-x86-cygwin)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-x86-linux-android)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-x86-linux-gnu)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-x86-linux-musl)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-x86-mingw-ucrt)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-x86_64-cygwin)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-x86_64-darwin)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-x86_64-linux-android)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-x86_64-linux-gnu)
google-protobuf (~> 4.27)
sass-embedded (1.79.3-x86_64-linux-musl)
google-protobuf (~> 4.27)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.6.0)
webrick (1.8.1)

PLATFORMS
aarch64-linux
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why so many platforms here ... none of our other Gemfile.locks have so many platforms. Not sure if it matters though 🤷🏼

aarch64-linux-android
aarch64-linux-gnu
aarch64-linux-musl
aarch64-mingw-ucrt
arm-linux-androideabi
arm-linux-gnu
arm-linux-gnueabihf
arm-linux-musl
arm-linux-musleabihf
arm64-darwin
riscv64-linux-android
riscv64-linux-gnu
riscv64-linux-musl
ruby
x86-cygwin
x86-linux
x86-linux-android
x86-linux-gnu
x86-linux-musl
x86-mingw-ucrt
x86_64-cygwin
x86_64-darwin
x86_64-linux
x86_64-linux-android
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
http_parser.rb (~> 0.6.0)
jekyll (~> 4.3.4)
jekyll-feed (~> 0.12)
minima (~> 2.5)
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1)

BUNDLED WITH
2.5.19
55 changes: 55 additions & 0 deletions help/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
#
# If you need help with YAML syntax, here are some quick references for you:
# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
# https://learnxinyminutes.com/docs/yaml/
#
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.

title: Your awesome title
email: your-email@example.com
description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
github_username: jekyll

# Build settings
theme: minima
plugins:
- jekyll-feed

# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
# the internal "default list".
#
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
#
# exclude:
# - .sass-cache/
# - .jekyll-cache/
# - gemfiles/
# - Gemfile
# - Gemfile.lock
# - node_modules/
# - vendor/bundle/
# - vendor/cache/
# - vendor/gems/
# - vendor/ruby/
Loading
Loading