-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
497 changed files
with
8,823 additions
and
6,618 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
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ runs: | |
- name: Set up git for OSBotify | ||
shell: bash | ||
run: | | ||
git config user.signingkey 367811D53E34168C | ||
git config user.signingkey AEE1036472A782AB | ||
git config commit.gpgsign true | ||
git config user.name OSBotify | ||
git config user.email [email protected] | ||
|
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 |
---|---|---|
|
@@ -50,7 +50,7 @@ runs: | |
- name: Set up git for OSBotify | ||
shell: bash | ||
run: | | ||
git config user.signingkey 367811D53E34168C | ||
git config user.signingkey AEE1036472A782AB | ||
git config commit.gpgsign true | ||
git config user.name OSBotify | ||
git config user.email [email protected] | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// eslint-disable-next-line lodash/import-scope | ||
import type {DebouncedFunc} from 'lodash'; | ||
|
||
/** | ||
|
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 |
Binary file not shown.
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,110 @@ | ||
name: Deploy New Help Site | ||
|
||
on: | ||
# Run on any push to main that has changes to the help directory. This will cause this | ||
# to deploy the latest code to newhelp.expensify.com | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'help/**' | ||
- './.github/workflows/deployNewHelp.yml' | ||
|
||
# Run on any pull request (except PRs against staging or production) that has | ||
# changes to the help directory. This will cause it to deploy this unmerged branch to | ||
# a Cloudflare "preview" environment | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches-ignore: [staging, production] | ||
paths: | ||
- 'help/**' | ||
- './.github/workflows/deployNewHelp.yml' | ||
# Run on any manual trigger | ||
workflow_dispatch: | ||
|
||
# Allow only one concurrent deployment | ||
concurrency: | ||
group: "newhelp" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
env: | ||
# Open source contributors do not have write access to the Expensify/App repo, | ||
# so must submit PRs from forks. This variable detects if the PR is coming | ||
# from a fork, and thus is from an outside contributor. | ||
IS_PR_FROM_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }} | ||
|
||
# Set up a clean Ubuntu build environment | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# We start by checking out the entire repo into a clean build environment within | ||
# the Github Action | ||
- 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 | ||
|
||
# Manually run Jekyll, bypassing Github Pages | ||
- name: Build Jekyll site | ||
run: bundle exec jekyll build --source ./ --destination ./_site | ||
working-directory: ./help # Ensure Jekyll is building the site in /help | ||
|
||
# This will copy the contents of /help/_site to Cloudflare. The pages-action will | ||
# evaluate the current branch to determine into which CF environment to deploy: | ||
# - If you are on 'main', it will deploy to 'production' in Cloudflare | ||
# - Otherwise it will deploy to a 'preview' environment made for this branch | ||
- name: Deploy to Cloudflare Pages | ||
uses: cloudflare/pages-action@v1 | ||
id: cloudflarePagesAction | ||
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 | ||
|
||
# After deploying Cloudflare preview build, share wherever it deployed to in the PR comment. | ||
- 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('Your New Help changes have been deployed to {0} :zap:️', steps.cloudflarePagesAction.outputs.alias) }} | ||
|
||
- name: Get merged pull request | ||
if: ${{ github.event_name == 'push' }} | ||
id: getMergedPullRequest | ||
uses: actions-ecosystem/action-get-merged-pull-request@59afe90821bb0b555082ce8ff1e36b03f91553d9 | ||
with: | ||
github_token: ${{ github.token }} | ||
|
||
- name: Leave a comment on the PR after it's merged | ||
if: ${{ github.event_name == 'push' }} | ||
run: | | ||
gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} --body "$(cat <<'EOF' | ||
🚀Deployed to [NewHelp production](https://newhelp.expensify.com)! 🚀 | ||
([_View deploy workflow run_](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})) | ||
EOF | ||
)" | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
# Use the Cloudflare CLI... | ||
- name: Setup Cloudflare CLI | ||
if: ${{ env.IS_PR_FROM_FORK != 'true' }} | ||
run: pip3 install cloudflare==2.19.0 | ||
|
||
# ... to purge the cache, such that all users will see the latest content. | ||
- 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 }} |
Oops, something went wrong.