Skip to content

Commit

Permalink
Merge pull request #49628 from Expensify/new_help_branch
Browse files Browse the repository at this point in the history
Creating the NewHelp site with a default Jekyll installation
  • Loading branch information
roryabraham authored Sep 27, 2024
2 parents a459ee8 + 4c45ce3 commit 73d3486
Show file tree
Hide file tree
Showing 16 changed files with 552 additions and 3 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/deployNewHelp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Deploy New Help Site

on:
# Run on any push to main that has changes to the help directory
# TEST: Verify Cloudflare picks this up even if not run when merged to main
# push:
# branches:
# - main
# paths:
# - 'help/**'

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

# Run on any manual trigger
workflow_dispatch:

# Allow only one concurrent deployment
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 code
uses: actions/checkout@v4

# Set up Ruby and run bundle install inside the /help directory
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: ./help

- name: Build Jekyll site
run: bundle exec jekyll build --source ./ --destination ./_site
working-directory: ./help # Ensure Jekyll is building the site in /help

- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
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 # Deploy the built 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/runner/.local/bin/cli4 --verbose --delete hosts=["newhelp.expensify.com"] /zones/:9ee042e6cfc7fd45e74aa7d2f78d617b/purge_cache
env:
CF_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }}

- name: Leave a comment on the PR
uses: actions-cool/maintain-one-comment@v3.2.0
if: ${{ github.event_name == 'pull_request' && env.IS_PR_FROM_FORK != 'true' }}
with:
token: ${{ github.token }}
body: ${{ format('A preview of your New Help changes have been deployed to {0} :zap:️', steps.deploy.outputs.alias) }}

2 changes: 1 addition & 1 deletion .github/workflows/preDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Process new code merged to main
on:
push:
branches: [main]
paths-ignore: [docs/**, contributingGuides/**, jest/**, tests/**]
paths-ignore: [docs/**, help/**, contributingGuides/**, jest/**, tests/**]

jobs:
typecheck:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reassurePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
types: [opened, synchronize]
branches-ignore: [staging, production]
paths-ignore: [docs/**, .github/**, contributingGuides/**, tests/**, '**.md', '**.sh']
paths-ignore: [docs/**, help/**, .github/**, contributingGuides/**, tests/**, '**.md', '**.sh']

jobs:
perf-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sendReassurePerfData.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Send Reassure Performance Tests to Graphite
on:
push:
branches: [main]
paths-ignore: [docs/**, contributingGuides/**, jest/**]
paths-ignore: [docs/**, help/**, contributingGuides/**, jest/**]

jobs:
perf-tests:
Expand Down
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
1 change: 1 addition & 0 deletions help/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.4
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>
19 changes: 19 additions & 0 deletions help/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
source "https://rubygems.org"

gem "jekyll", "~> 4.3.4"
gem "minima", "~> 2.5"
gem "nokogiri"

group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end

# If using tzinfo-data for timezone support, ensure it's bundled for relevant platforms
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

gem "wdm", "~> 0.1", platforms: [:mingw, :x64_mingw, :mswin]
gem "http_parser.rb", "~> 0.6.0", platforms: [:jruby]

200 changes: 200 additions & 0 deletions help/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
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)
mini_portile2 (2.8.7)
minima (2.5.2)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.7-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.7-arm-linux)
racc (~> 1.4)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86-linux)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (6.0.1)
racc (1.8.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.2)

PLATFORMS
aarch64-linux
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)
nokogiri
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1)

BUNDLED WITH
2.5.19
7 changes: 7 additions & 0 deletions help/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: New Expensify Help
email: concierge@expensify.com
description: Comprehensive help documentation for New Expensify.
url: https://newhelp.expensify.com
twitter_username: expensify
github_username: expensify

25 changes: 25 additions & 0 deletions help/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ page.title }}</title>
</head>
<body>
<header>
<nav>
<!-- Navigation links, logo, etc. -->
</nav>
</header>

<!-- This is where the content from product.html or any other layout will be inserted -->
<main>
{{ content }}
</main>

<footer>
<p>&copy; 2024 Your Website</p>
</footer>
</body>
</html>

Loading

0 comments on commit 73d3486

Please sign in to comment.