Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity committed Sep 14, 2024
1 parent a57ef0e commit 8ce5c10
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 87 deletions.
26 changes: 14 additions & 12 deletions .github/actions/vercel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ outputs:
deployment_url:
description: The URL of the deployment
value: ${{ steps.deploy-preview.outputs.deployment_url || steps.deploy-production.outputs.deployment_url }}
skip:
description: Skip the deployment
value: ${{ steps.ignore-build.outputs.exit_code == 0 }}

runs:
using: "composite"
Expand All @@ -40,57 +43,56 @@ runs:
run_install: false # install is handled by vercel build

- name: Ignore Build Step
id: ignore-build
shell: bash
if: ${{ inputs.force == 'false' }}
if: inputs.force == 'false'
continue-on-error: true
run: |
pnpx turbo-ignore ${{ inputs.package }} --fallback=HEAD^1
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "No changes detected in ${{ inputs.package }} since last deployment. Skipping deployment."
exit 0
fi
export "exit_code=$?" >> $GITHUB_OUTPUT
- name: Install Vercel CLI
if: steps.ignore-build.outputs.exit_code == 1
shell: bash
run: pnpm install --global vercel@latest

- name: Pull Vercel Environment
if: steps.ignore-build.outputs.exit_code == 1
shell: bash
run: vercel pull --yes --environment=${{ inputs.environment }} --token=${{ inputs.token }}

- name: Build Vercel Preview
shell: bash
if: ${{ inputs.environment == 'preview' }}
if: steps.ignore-build.outputs.exit_code == 1 && inputs.environment == 'preview'
run: vercel build --yes --token=${{ inputs.token }}

- name: Deploy Vercel Preview
shell: bash
if: ${{ inputs.environment == 'preview' && inputs.skip_deploy == 'false' }}
if: steps.ignore-build.outputs.exit_code == 1 && inputs.environment == 'preview' && inputs.skip_deploy == 'false'
id: deploy-preview
run: |
DEPLOYMENT_URL="$(vercel deploy --yes --prebuilt --token=${{ inputs.token }} --archive=tgz)"
echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT
- name: Build Vercel Production
shell: bash
if: ${{ inputs.environment == 'production' }}
if: steps.ignore-build.outputs.exit_code == 1 && inputs.environment == 'production'
run: vercel build --yes --prod --token=${{ inputs.token }}

- name: Deploy Vercel Production
shell: bash
if: ${{ inputs.environment == 'production' && inputs.skip_deploy == 'false' }}
if: steps.ignore-build.outputs.exit_code == 1 && inputs.environment == 'production' && inputs.skip_deploy == 'false'
id: deploy-production
run: |
DEPLOYMENT_URL="$(vercel deploy --yes --prebuilt --prod --skip-domain --token=${{ inputs.token }} --archive=tgz)"
echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT
- name: Wait for Deployment
shell: bash
if: ${{ inputs.skip_deploy == 'false' }}
if: steps.ignore-build.outputs.exit_code == 1 && inputs.skip_deploy == 'false'
run: vercel inspect ${{ steps.deploy-preview.outputs.deployment_url || steps.deploy-production.outputs.deployment_url }} --token=${{ inputs.token }} --wait

- name: Promote Vercel Production
shell: bash
if: ${{ inputs.environment == 'production' && inputs.skip_deploy == 'false' && inputs.promote == 'true' }}
if: steps.ignore-build.outputs.exit_code == 1 && inputs.environment == 'production' && inputs.skip_deploy == 'false' && inputs.promote == 'true'
run: vercel promote ${{ steps.deploy-production.outputs.deployment_url }} --token=${{ inputs.token }}
3 changes: 3 additions & 0 deletions .github/workflows/deploy-docs-bundle-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
url: ${{ steps.deploy.outputs.deployment_url }}
outputs:
deployment_url: ${{ steps.deploy.outputs.deployment_url }}
skip: ${{ steps.deploy.outputs.skip }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -41,6 +42,7 @@ jobs:

deploy-dev:
needs: deploy # this will run after the deploy job to leverage turbo's build cache
if: needs.deploy.outputs.skip == 'false'
runs-on: ubuntu-latest
environment:
name: Preview - app-dev.buildwithfern.com
Expand Down Expand Up @@ -94,6 +96,7 @@ jobs:

ete:
needs: deploy
if: needs.deploy.outputs.skip == 'false'
runs-on: ubuntu-latest
permissions: write-all
steps:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/deploy-docs-bundle-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
url: ${{ steps.deploy.outputs.deployment_url }}
outputs:
deployment_url: ${{ steps.deploy.outputs.deployment_url }}
skip: ${{ steps.deploy.outputs.skip }}
env:
VERCEL_PROJECT_ID: prj_QX3venU6jwRUmdt8ArfL8AU5r1d4
steps:
Expand All @@ -45,6 +46,7 @@ jobs:
url: ${{ steps.deploy.outputs.deployment_url }}
outputs:
deployment_url: ${{ steps.deploy.outputs.deployment_url }}
skip: ${{ steps.deploy.outputs.skip }}
env:
VERCEL_PROJECT_ID: prj_SfgTTzw7KefTMuVWsL5uhY8Y4BIt
steps:
Expand All @@ -68,6 +70,7 @@ jobs:
url: ${{ steps.deploy.outputs.deployment_url }}
outputs:
deployment_url: ${{ steps.deploy.outputs.deployment_url }}
skip: ${{ steps.deploy.outputs.skip }}
env:
VERCEL_PROJECT_ID: prj_GGc6CEzrWNyUK0hq1UK7KmbgUmZn
steps:
Expand All @@ -85,6 +88,7 @@ jobs:

ete:
needs: deploy_app_buildwithfern_com
if: needs.deploy_app_buildwithfern_com.outputs.skip == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -112,6 +116,7 @@ jobs:
- ${{ needs.deploy_app_buildwithfern_com.outputs.deployment_url }}
- ${{ needs.deploy_app_ferndocs_com.outputs.deployment_url }}
- ${{ needs.deploy_app-slash_ferndocs_com.outputs.deployment_url }}
if: needs.deploy_app_buildwithfern_com.outputs.skip == 'false' && needs.deploy_app_ferndocs_com.outputs.skip == 'false' && needs.deploy_app-slash_ferndocs_com.outputs.skip == 'false'
steps:
- uses: actions/checkout@v4

Expand Down
4 changes: 1 addition & 3 deletions clis/docs-migrator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"outDir": "./dist",
"rootDir": "."
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../../packages/commons/core-utils"
Expand Down
4 changes: 1 addition & 3 deletions clis/generator-cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"outDir": "dist",
"rootDir": "."
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../../packages/commons/github"
Expand Down
4 changes: 1 addition & 3 deletions packages/commons/fdr-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../../fdr-sdk"
Expand Down
4 changes: 1 addition & 3 deletions packages/commons/loadable/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../core-utils"
Expand Down
4 changes: 1 addition & 3 deletions packages/commons/react/common-components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../../loadable"
Expand Down
4 changes: 1 addition & 3 deletions packages/commons/react/react-commons/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../../core-utils"
Expand Down
4 changes: 1 addition & 3 deletions packages/commons/react/react-query-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../../loadable"
Expand Down
4 changes: 1 addition & 3 deletions packages/commons/search-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../../fdr-sdk"
Expand Down
4 changes: 1 addition & 3 deletions packages/healthchecks/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"outDir": "dist",
"rootDir": "."
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../commons/core-utils"
Expand Down
4 changes: 1 addition & 3 deletions packages/template-resolver/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../fdr-sdk"
Expand Down
4 changes: 1 addition & 3 deletions packages/ui/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../../commons/react/react-commons"
Expand Down
20 changes: 4 additions & 16 deletions packages/ui/fern-dashboard/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"types": [
"vite/client",
"node"
],
"types": ["vite/client", "node"],
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
Expand All @@ -28,15 +21,10 @@
"noFallthroughCasesInSwitch": true,
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
"@/*": ["./src/*"]
}
},
"include": [
"src",
"vite.config.ts"
],
"include": ["src", "vite.config.ts"],
"references": [
{
"path": "../../commons/react/react-commons"
Expand Down
8 changes: 2 additions & 6 deletions servers/fdr/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"rootDir": "./src",
"isolatedModules": false,
"paths": {
"@prisma/client": [
"../prisma/client"
]
"@prisma/client": ["../prisma/client"]
},
"sourceMap": true,
"inlineSources": true,
Expand All @@ -16,9 +14,7 @@
// This improves issue grouping in Sentry.
"sourceRoot": "/"
},
"include": [
"./src/**/*"
],
"include": ["./src/**/*"],
"references": [
{
"path": "../../packages/commons/github"
Expand Down
26 changes: 6 additions & 20 deletions servers/fern-bot/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@functions/*": [
"src/functions/*"
],
"@libs/*": [
"src/libs/*"
]
"@functions/*": ["src/functions/*"],
"@libs/*": ["src/libs/*"]
},
"lib": [
"ESNext",
"DOM"
],
"lib": ["ESNext", "DOM"],
"module": "esnext",
"moduleResolution": "node",
"noUnusedLocals": true,
Expand All @@ -24,14 +17,9 @@
"outDir": "lib",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"types": [
"vitest/globals"
]
"types": ["vitest/globals"]
},
"include": [
"src/**/*.ts",
"serverless.ts"
],
"include": ["src/**/*.ts", "serverless.ts"],
"exclude": [
"node_modules/**/*",
".serverless/**/*",
Expand All @@ -41,9 +29,7 @@
"src/__test__/**/*"
],
"ts-node": {
"require": [
"tsconfig-paths/register"
]
"require": ["tsconfig-paths/register"]
},
"references": [
{
Expand Down

0 comments on commit 8ce5c10

Please sign in to comment.