Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity committed Sep 14, 2024
1 parent c54f4c3 commit 165752c
Show file tree
Hide file tree
Showing 28 changed files with 66 additions and 54 deletions.
17 changes: 10 additions & 7 deletions .github/actions/vercel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Build & Deploy to Vercel
description: Build and deploy a Vercel project using CI/CD

inputs:
token:
description: The Vercel token to use for deployment
required: true
package:
description: The workspace package to deploy, which is used for turbo-ignore
required: true
Expand Down Expand Up @@ -29,7 +32,7 @@ runs:
steps:
- name: Install
if: $(command -v pnpm) == ""
uses: ./.github/actions/install
uses: .github/actions/install
with:
run_install: false # install is handled by vercel build

Expand All @@ -52,35 +55,35 @@ runs:

- name: Pull Vercel Environment
shell: bash
run: vercel pull --yes --environment=${{ inputs.environment }} --token=${{ secrets.VERCEL_TOKEN }}
run: vercel pull --yes --environment=${{ inputs.environment }} --token=${{ inputs.token }}

- name: Build Vercel Preview
shell: bash
if: ${{ inputs.environment == 'preview' }}
run: vercel build --yes --token=${{ secrets.VERCEL_TOKEN }}
run: vercel build --yes --token=${{ inputs.token }}

- name: Deploy Vercel Preview
shell: bash
if: ${{ inputs.environment == 'preview' && inputs.skip_deploy == 'false' }}
id: deploy-preview
run: |
DEPLOYMENT_URL="$(vercel deploy --yes --prebuilt --token=${{ secrets.VERCEL_TOKEN }}) --archive=tgz"
DEPLOYMENT_URL="$(vercel deploy --yes --prebuilt --token=${{ inputs.token }}) --archive=tgz"
echo "::set-output name=deployment_url::$DEPLOYMENT_URL"
- name: Build Vercel Production
shell: bash
if: ${{ inputs.environment == 'production' }}
run: vercel build --yes --prod --token=${{ secrets.VERCEL_TOKEN }} --archive=tgz
run: vercel build --yes --prod --token=${{ inputs.token }} --archive=tgz

- name: Deploy Vercel Production
shell: bash
if: ${{ inputs.environment == 'production' && inputs.skip_deploy == 'false' }}
id: deploy-production
run: |
DEPLOYMENT_URL="$(vercel deploy --yes --prebuilt --prod --skip-domain --token=${{ secrets.VERCEL_TOKEN }}) --archive=tgz"
DEPLOYMENT_URL="$(vercel deploy --yes --prebuilt --prod --skip-domain --token=${{ inputs.token }}) --archive=tgz"
echo "::set-output name=deployment_url::$DEPLOYMENT_URL"
- name: Wait for Deployment
shell: bash
if: ${{ inputs.skip_deploy == 'false' }}
run: vercel inspect ${{ steps.deploy-preview.outputs.deployment_url || steps.deploy-production.outputs.deployment_url }} --token=${{ secrets.VERCEL_TOKEN }} --wait
run: vercel inspect ${{ steps.deploy-preview.outputs.deployment_url || steps.deploy-production.outputs.deployment_url }} --token=${{ inputs.token }} --wait
3 changes: 2 additions & 1 deletion .github/workflows/analyze-docs-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ jobs:
- uses: actions/checkout@v3

- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
uses: .github/actions/vercel
id: deploy
env:
ANALYZE: 1
with:
token: ${{ secrets.VERCEL_TOKEN }}
package: "@fern-ui/docs-bundle"
environment: production
skip_deploy: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fetch-depth: 2 # This helps turbo resolve changes faster

- name: Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: Compile and build
run: pnpm turbo compile codegen build
Expand All @@ -44,7 +44,7 @@ jobs:
fetch-depth: 2 # This helps turbo resolve changes faster

- name: Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: Lint style
run: pnpm turbo lint:style
Expand All @@ -61,7 +61,7 @@ jobs:
fetch-depth: 0

- name: Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: Run Chromatic
uses: chromaui/action@latest
Expand All @@ -79,7 +79,7 @@ jobs:
fetch-depth: 2 # This helps turbo resolve changes faster

- name: Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: Log in to Docker Hub
uses: docker/login-action@v3
Expand All @@ -103,7 +103,7 @@ jobs:
fetch-depth: 2 # This helps turbo resolve changes faster

- name: Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: 🧪 Build generator-cli
run: pnpm turbo --filter=@fern-api/generator-cli compile
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
fetch-depth: 2 # This helps turbo resolve changes faster

- name: Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: Check release blockers
run: pnpm check-docs-release-blockers
3 changes: 2 additions & 1 deletion .github/workflows/deploy-docs-bundle-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ jobs:
- uses: actions/checkout@v4

- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
uses: .github/actions/vercel
id: deploy
with:
token: ${{ secrets.VERCEL_TOKEN }}
package: "@fern-ui/docs-bundle"
environment: production

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/deploy-docs-bundle-prod-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ jobs:
- uses: actions/checkout@v4

- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
uses: .github/actions/vercel
id: deploy
with:
token: ${{ secrets.VERCEL_TOKEN }}
package: "@fern-ui/docs-bundle"
environment: preview

Expand Down Expand Up @@ -76,5 +77,5 @@ jobs:

ete-tests:
needs: fetch-domains
uses: ./.github/workflows/ete-docs-bundle.yml
uses: .github/workflows/ete-docs-bundle.yml
secrets: inherit
15 changes: 9 additions & 6 deletions .github/workflows/deploy-docs-bundle-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ jobs:
- uses: actions/checkout@v4

- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
uses: .github/actions/vercel
id: deploy
with:
token: ${{ secrets.VERCEL_TOKEN }}
package: "@fern-ui/docs-bundle"
environment: production

Expand All @@ -48,9 +49,10 @@ jobs:
- uses: actions/checkout@v4

- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
uses: .github/actions/vercel
id: deploy
with:
token: ${{ secrets.VERCEL_TOKEN }}
package: "@fern-ui/docs-bundle"
environment: production

Expand All @@ -68,9 +70,10 @@ jobs:
- uses: actions/checkout@v4

- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
uses: .github/actions/vercel
id: deploy
with:
token: ${{ secrets.VERCEL_TOKEN }}
package: "@fern-ui/docs-bundle"
environment: production

Expand All @@ -96,7 +99,7 @@ jobs:
needs:
- fetch-domains
- deploy_app_buildwithfern_com
uses: ./.github/workflows/ete-docs-bundle.yml
uses: .github/workflows/ete-docs-bundle.yml
secrets:
DEPLOYMENT_URL: ${{ needs.deploy_app_buildwithfern_com.outputs.deployment_url }}

Expand Down Expand Up @@ -124,7 +127,7 @@ jobs:

revalidate-all:
needs: promote # Ensure that the deployment is promoted before revalidating
uses: ./.github/workflows/revalidate-all.yml
uses: .github/workflows/revalidate-all.yml
with:
deployment_url: https://app.buildwithfern.com

Expand Down Expand Up @@ -153,5 +156,5 @@ jobs:
healthchecks:
needs: promote # Ensure that the deployment is promoted before running healthchecks
uses: ./.github/workflows/healthcheck.yml
uses: .github/workflows/healthcheck.yml
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/deploy-fdr-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:

jobs:
sdk:
uses: ./.github/workflows/publish-fdr-sdk.yml
uses: .github/workflows/publish-fdr-sdk.yml
secrets: inherit

deploy_dev:
Expand All @@ -45,7 +45,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: 📥 Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: 🔎 Has changed
id: has-changed
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-fdr-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
jobs:
sdk:
if: github.ref_type == 'tag' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/fdr@')
uses: ./.github/workflows/publish-fdr-sdk.yml
uses: .github/workflows/publish-fdr-sdk.yml
secrets: inherit

deploy_prod:
Expand All @@ -39,7 +39,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: 📥 Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: 🧪 Build and test
run: pnpm turbo build test --filter=${{ env.PACKAGE_NAME }}
Expand Down Expand Up @@ -90,5 +90,5 @@ jobs:
healthchecks:
needs: deploy_prod
uses: ./.github/workflows/healthcheck.yml
uses: .github/workflows/healthcheck.yml
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/deploy-fern-bot-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v4

- name: 📥 Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: Compile
run: pnpm compile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-fern-bot-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v4

- name: 📥 Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: Compile
run: pnpm compile
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-fern-dashboard-dev-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ jobs:
- uses: actions/checkout@v4

- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
uses: .github/actions/vercel
id: deploy
with:
token: ${{ secrets.VERCEL_TOKEN }}
package: "@fern-ui/dashboard"
environment: preview
3 changes: 2 additions & 1 deletion .github/workflows/deploy-fern-dashboard-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ jobs:
- uses: actions/checkout@v4

- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
uses: .github/actions/vercel
id: deploy
with:
token: ${{ secrets.VERCEL_TOKEN }}
package: "@fern-ui/dashboard"
environment: production

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-fern-dashboard-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ jobs:
- uses: actions/checkout@v4

- name: Build & Deploy to Vercel
uses: ./.github/actions/vercel
uses: .github/actions/vercel
id: deploy
with:
token: ${{ secrets.VERCEL_TOKEN }}
package: "@fern-ui/dashboard"
environment: production

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-local-preview-bundle-dryrun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install
uses: ./.github/actions/install
uses: .github/actions/install
- name: Build local preview bundle
run: |
pnpm compile
Expand All @@ -44,7 +44,7 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install
uses: ./.github/actions/install
uses: .github/actions/install
- name: Build local preview bundle
run: |
pnpm compile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-local-preview-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install
uses: ./.github/actions/install
uses: .github/actions/install
- name: Build local preview bundle
run: |
pnpm compile
Expand All @@ -48,7 +48,7 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install
uses: ./.github/actions/install
uses: .github/actions/install
- name: Build local preview bundle
run: |
pnpm compile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/diff-fdr-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: 📥 Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: 🔎 Has changed
id: has-changed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ete-docs-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: Download artifact
uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ete-fdr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
fetch-depth: 2 # This helps turbo resolve changes faster

- name: Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: Install Docker Compose
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/healthcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fetch-depth: 0

- name: 📥 Install
uses: ./.github/actions/install
uses: .github/actions/install

- name: 🧪 Build Healthchecks CLI
run: |
Expand Down
Loading

0 comments on commit 165752c

Please sign in to comment.