forked from campsite/campsite
-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit dae5db8
Showing
4,809 changed files
with
355,347 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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,18 @@ | ||
.git | ||
**/node_modules | ||
**/dist | ||
**/out | ||
**/.next | ||
**/.turbo | ||
api | ||
elasticsearch | ||
logs | ||
notebooks | ||
ops/aws | ||
script | ||
vendor | ||
.venv | ||
.vercel | ||
.vscode | ||
.github | ||
zapier |
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,8 @@ | ||
# See https://git-scm.com/docs/gitattributes for more about git attribute files. | ||
|
||
# Mark any vendored files as having been vendored. | ||
api/vendor/* linguist-vendored | ||
vendor/* linguist-vendored | ||
|
||
# Mark the database schema as generated. | ||
packages/types/generated.ts linguist-generated |
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,21 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
versioning-strategy: increase | ||
schedule: | ||
interval: 'weekly' | ||
day: 'monday' | ||
allow: | ||
- dependency-name: '@sentry/*' | ||
- dependency-name: '@tanstack/*' | ||
- dependency-name: 'next' | ||
- dependency-name: 'eslint-config-next' | ||
- dependency-name: '@next/bundle-analyzer' | ||
# This option has no impact on security updates which have a separate internal limit of 10 PRs | ||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#open-pull-requests-limit | ||
open-pull-requests-limit: 2 | ||
commit-message: | ||
# Prefix all commit messages with "chore: " | ||
prefix: 'chore' | ||
include: 'scope' |
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,2 @@ | ||
"Migrations pending": | ||
- "api/db/migrate/**/*" |
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,16 @@ | ||
name-template: "v$RESOLVED_VERSION" | ||
tag-template: "v$RESOLVED_VERSION" | ||
|
||
version-resolver: | ||
default: major | ||
|
||
template: | | ||
--- | ||
title: Changelog title | ||
date: 2023-MM-DD | ||
slug: 2023-MM-DD-changelog-title-slugified | ||
contributors: $CONTRIBUTORS | ||
feature_image: optional | ||
--- | ||
$CHANGES |
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,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
DRY_RUN=${DRY_RUN:-false} | ||
|
||
# get description of the latest tag matching the pattern (e.g. "api*") | ||
# then remove the commit hash and number of commits since the tag to get the raw tag name | ||
# works for annotated and lightweight tags | ||
function echo_ref() { | ||
|
||
# find the latest commit matching the tag pattern | ||
MATCH=$(git describe --match "$1*" --tags 2>/dev/null) | ||
|
||
# if no match, default to the first commit which should guarantee a deploy | ||
if [ -z "$MATCH" ]; then | ||
MATCH=$(git rev-list --max-parents=0 HEAD) | ||
fi | ||
|
||
LATEST_TAG=$(echo $MATCH | sed 's/-[0-9]*-g[0-9a-f]\{7,9\}//') | ||
LATEST_REF=$(git rev-list -n 1 $LATEST_TAG) | ||
ECHO_OUTPUT="$1=$LATEST_REF" | ||
if [[ $DRY_RUN == "true" ]]; then | ||
echo $ECHO_OUTPUT | ||
else | ||
echo $ECHO_OUTPUT >> $GITHUB_OUTPUT | ||
fi | ||
} | ||
|
||
echo_ref "api" | ||
echo_ref "site" | ||
echo_ref "web" | ||
echo_ref "elasticsearch" | ||
echo_ref "logs" | ||
echo_ref "html-to-image" | ||
echo_ref "sync-server" | ||
echo_ref "styled-text-server" |
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,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
DRY_RUN=${DRY_RUN:-false} | ||
|
||
# get the message and trim to the first line | ||
GIT_MESSAGE=$(git log -1 --pretty=%B HEAD | head -n 1) | ||
ECHO_MESSAGE_OUTPUT="git-message=$GIT_MESSAGE" | ||
ESCAPED_GIT_MESSAGE=$(echo "$GIT_MESSAGE" | sed 's/"/\\"/g') | ||
ECHO_ESCAPED_MESSAGE_OUTPUT="escaped-git-message=$ESCAPED_GIT_MESSAGE" | ||
|
||
SHA_SHORT=$(git rev-parse --short HEAD) | ||
ECHO_SHA_OUTPUT="git-sha=$SHA_SHORT" | ||
|
||
if [[ $DRY_RUN == "true" ]]; then | ||
echo $ECHO_MESSAGE_OUTPUT | ||
echo $ECHO_ESCAPED_MESSAGE_OUTPUT | ||
echo $ECHO_SHA_OUTPUT | ||
else | ||
echo $ECHO_MESSAGE_OUTPUT >> $GITHUB_OUTPUT | ||
echo $ECHO_ESCAPED_MESSAGE_OUTPUT >> $GITHUB_OUTPUT | ||
echo $ECHO_SHA_OUTPUT >> $GITHUB_OUTPUT | ||
fi |
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,21 @@ | ||
name: API Tests | ||
|
||
on: | ||
pull_request: | ||
# must be in sync with the paths filter in tests.yml | ||
paths-ignore: | ||
- '.github/workflows/api-tests.yml' | ||
- 'api/**' | ||
|
||
jobs: | ||
# names must match those in tests.yml | ||
test: | ||
name: tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' |
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,100 @@ | ||
name: API Tests | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/api-tests.yml' | ||
- 'api/**' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
MYSQL_DB: campsite_api_test | ||
MYSQL_USER: root | ||
MYSQL_PASSWORD: root | ||
DATABASE_HOST: 127.0.0.1 | ||
RAILS_ENV: test | ||
|
||
jobs: | ||
test: | ||
name: tests | ||
runs-on: | ||
labels: warp-ubuntu-latest-x64-8x | ||
timeout-minutes: 10 | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
services: | ||
redis: | ||
image: redis | ||
ports: | ||
- 6379/tcp | ||
options: --entrypoint redis-server | ||
steps: | ||
- name: GitHub App token | ||
id: gen-token | ||
uses: tibdex/[email protected] | ||
with: | ||
app_id: 290357 | ||
private_key: ${{ secrets.DEPLOYBOT_TOKEN }} | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.gen-token.outputs.token }} | ||
|
||
- name: Cache Ruby gems | ||
uses: actions/cache@v4 | ||
with: | ||
path: api/vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Setup MySQL | ||
uses: shogo82148/actions-setup-mysql@v1 | ||
with: | ||
mysql-version: '8.0' | ||
root-password: ${{ env.MYSQL_PASSWORD }} | ||
my-cnf: | | ||
authentication_policy=mysql_native_password | ||
- name: Create MySQL database | ||
working-directory: api | ||
run: | | ||
mysql -h 127.0.0.1 -e 'CREATE DATABASE ${{ env.MYSQL_DB }};' -u${{ env.MYSQL_USER }} -p${{ env.MYSQL_PASSWORD }} | ||
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -h 127.0.0.1 -u${{ env.MYSQL_USER }} -p${{ env.MYSQL_PASSWORD }} mysql | ||
mysql -h 127.0.0.1 -u${{ env.MYSQL_USER }} -p${{ env.MYSQL_PASSWORD }} -e 'SELECT COUNT(*) FROM mysql.time_zone_name;' | ||
- name: Setup Rails | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
working-directory: api | ||
bundler-cache: true | ||
|
||
# lint and push any fixes before building | ||
- name: Lint Ruby files | ||
working-directory: api | ||
run: bundle exec rubocop --parallel --autocorrect | ||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 🤖 linting with autofix | ||
branch: ${{ github.head_ref }} | ||
disable_globbing: true | ||
file_pattern: > | ||
api/**/*.rb api/**/*.erb api/Gemfile :!api/vendor/**/* | ||
- name: Setup Elasticsearch | ||
uses: ankane/setup-elasticsearch@v1 | ||
|
||
- name: Build and run tests | ||
env: | ||
REDIS_HOST: localhost | ||
REDIS_PORT: ${{ job.services.redis.ports[6379] }} | ||
working-directory: api | ||
run: | | ||
bundle exec rails db:schema:load | ||
bundle exec rails assets:precompile | ||
bundle exec rails test |
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,14 @@ | ||
name: Client Build | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- '.github/workflows/client-build.yml' | ||
- 'apps/**' | ||
- 'packages/**' | ||
|
||
jobs: | ||
client-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' |
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,106 @@ | ||
name: Client Build | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/client-build.yml' | ||
- 'turbo.json' | ||
- 'package.json' | ||
- 'pnpm-lock.yaml' | ||
- 'apps/**' | ||
- 'packages/**' | ||
|
||
env: | ||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
TIPTAP_PRIVATE_REGISTRY_KEY: ${{ secrets.TIPTAP_PRIVATE_REGISTRY_KEY }} | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | ||
TURBO_REMOTE_ONLY: true | ||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
SENTRY_ORG: campsite-software | ||
SENTRY_PROJECT: campsite-web | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
client-build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
steps: | ||
- name: GitHub App token | ||
id: gen-token | ||
uses: tibdex/[email protected] | ||
with: | ||
app_id: 290357 | ||
private_key: ${{ secrets.DEPLOYBOT_TOKEN }} | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.gen-token.outputs.token }} | ||
|
||
- uses: dorny/paths-filter@v3 | ||
id: changes | ||
with: | ||
filters: | | ||
client-web: | ||
- 'apps/web/**' | ||
- 'packages/**' | ||
figma: | ||
- 'apps/figma/**' | ||
- 'packages/ui/**' | ||
- 'packages/config/**' | ||
- 'packages/types/**' | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- run: pnpm config set "@tiptap-pro:registry" https://registry.tiptap.dev/ | ||
- run: pnpm config set "//registry.tiptap.dev/:_authToken" ${{ secrets.TIPTAP_PRIVATE_REGISTRY_KEY }} | ||
- run: pnpm install | ||
|
||
- run: pnpm format | ||
- run: pnpm lint:fix | ||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 🤖 linting with autofix | ||
branch: ${{ github.head_ref }} | ||
- name: Run tests | ||
run: pnpm turbo run test --filter=@campsite/web | ||
|
||
- name: Install Vercel CLI | ||
run: pnpm install --global vercel | ||
|
||
- name: Vercel Build Web | ||
if: ${{ steps.changes.outputs.client-web == 'true' }} | ||
env: | ||
VERCEL_PROJECT_ID: prj_ecDUhYR4IMEOyMnXJ9YkMgRInMS5 | ||
run: | | ||
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | ||
vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | ||
- name: Figma Build | ||
if: ${{ steps.changes.outputs.figma == 'true' }} | ||
run: | | ||
pnpm build --filter=@campsite/figma |
Oops, something went wrong.