Skip to content

fix: hide prev button (#1473) #1481

fix: hide prev button (#1473)

fix: hide prev button (#1473) #1481

Workflow file for this run

name: Vercel Development Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_SEARCH_INDEX: ${{ secrets.ALGOLIA_SEARCH_INDEX }}
FONTAWESOME_CDN_HOST: https://icons.ferndocs.com
WORKOS_API_KEY: ${{ secrets.WORKOS_STAGING_API_KEY }}
WORKOS_CLIENT_ID: ${{ secrets.WORKOS_STAGING_CLIENT_ID }}
JWT_SECRET_KEY: ${{ secrets.DEV_JWT_SECRET_KEY }}
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: "buildwithfern"
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.4.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: VERSION="$(scripts/git-version.sh)" ENABLE_SOURCE_MAPS=true vercel build --debug --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: |
DEPLOYMENT_URL="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
echo "Deployment URL: $DEPLOYMENT_URL"
echo "$DEPLOYMENT_URL" > deployment-url.txt # this will be used in a playwright test
DEPLOYMENT_INFO=$(curl -s -X GET "https://api.vercel.com/v9/projects/app.buildwithfern.com/domains?limit=50&teamId=team_6FKOM5nw037hv8g2mTk3gaH7&withGitRepoInfo=false" -H "Authorization: Bearer ${{ secrets.VERCEL_TOKEN }}")
ALIAS_DOMAINS=$(jq -r '.domains[].name' <<< $DEPLOYMENT_INFO)
echo "## PR Preview" > preview.txt
for DOMAIN in ${ALIAS_DOMAINS[@]}; do
echo "Handling domain: $DOMAIN"
if [[ "$DOMAIN" != *"buildwithfern.com"* ]] && [[ "$DOMAIN" != *"vercel.app"* ]]; then
echo "- [ ] [$DOMAIN]($DEPLOYMENT_URL/api/fern-docs/preview?host=$DOMAIN)" >> preview.txt
fi
done
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: deployment-url
path: deployment-url.txt
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: preview
path: preview.txt
smoke-test:
needs: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Smoke Test Dev Docs
env:
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}
FERN_TOKEN: ${{ secrets.FERN_ORG_TOKEN_DEV }}
run: |
cd smoke-test
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm install -g @fern-api/fern-api-dev
fern-dev generate --docs --instance https://fern-platform-test.docs.dev.buildwithfern.com
VALUE=$(curl https://fern-platform-test.docs.dev.buildwithfern.com/api-reference/imdb/create-movie)
length=${#VALUE}
# Assert that length is over 1000
if [ $length -gt 1000 ]; then
echo "Length is greater than 1000"
else
exit 1
fi
playwright-tests:
needs: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.4.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: preview
path: .
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: deployment-url
path: .
- name: pnpm install
run: pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test playwright/smoke --workers 6
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30