-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
…ture/45177-invoice-back-accounts-section
- Loading branch information
Showing
88 changed files
with
1,243 additions
and
608 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
ENV="$1" | ||
EXPECTED_VERSION="$2" | ||
|
||
BASE_URL="" | ||
if [[ "$ENV" == 'staging' ]]; then | ||
BASE_URL='https://staging.new.expensify.com' | ||
else | ||
BASE_URL='https://new.expensify.com' | ||
fi | ||
|
||
sleep 5 | ||
ATTEMPT=0 | ||
MAX_ATTEMPTS=10 | ||
while [[ $ATTEMPT -lt $MAX_ATTEMPTS ]]; do | ||
((ATTEMPT++)) | ||
|
||
echo "Attempt $ATTEMPT: Checking deployed version..." | ||
DOWNLOADED_VERSION="$(wget -q -O /dev/stdout "$BASE_URL"/version.json | jq -r '.version')" | ||
|
||
if [[ "$EXPECTED_VERSION" == "$DOWNLOADED_VERSION" ]]; then | ||
echo "Success: Deployed version matches local version: $DOWNLOADED_VERSION" | ||
exit 0 | ||
fi | ||
|
||
if [[ $ATTEMPT -lt $MAX_ATTEMPTS ]]; then | ||
echo "Version mismatch, found $DOWNLOADED_VERSION. Retrying in 5 seconds..." | ||
sleep 5 | ||
fi | ||
done | ||
|
||
echo "Error: Deployed version did not match local version after $MAX_ATTEMPTS attempts. Something went wrong..." | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | ||
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) }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
_site | ||
.sass-cache | ||
.jekyll-cache | ||
.jekyll-metadata | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.3.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
|
Oops, something went wrong.