Turbo #341
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
# Name of our action | |
name: Build | |
# The event that will trigger the action | |
on: | |
pull_request: | |
branches: [main] | |
# what the action will do | |
jobs: | |
build: | |
# The operating system it will run on | |
runs-on: ubuntu-latest | |
# This check needs to be in place to prevent a publish loop with auto and github actions | |
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" | |
# The list of steps that the action will go through | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare repository | |
run: git fetch --unshallow --tags | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- 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- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Create .env.local file | |
run: | | |
touch apps/app/.env.local | |
echo "CLERK_SECRET_KEY=sk_test_JA==" >> apps/app/.env.local | |
echo "CLERK_WEBHOOK_SECRET=whsec_test" >> apps/app/.env.local | |
echo "RESEND_AUDIENCE_ID=test" >> apps/app/.env.local | |
echo "RESEND_FROM=test@test.com" >> apps/app/.env.local | |
echo "DATABASE_URL=postgresql://test:test@localhost:5432/test" >> apps/app/.env.local | |
echo "RESEND_TOKEN=re_test" >> apps/app/.env.local | |
echo "STRIPE_SECRET_KEY=sk_test" >> apps/app/.env.local | |
echo "STRIPE_WEBHOOK_SECRET=whsec_test" >> apps/app/.env.local | |
echo "BETTERSTACK_API_KEY=test" >> apps/app/.env.local | |
echo "BETTERSTACK_URL=https://test.com" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_JA==" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_GA_MEASUREMENT_ID=G-test" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_POSTHOG_KEY=phc_test" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_POSTHOG_HOST=https://test.com" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_APP_URL=http://localhost:3000" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_WEB_URL=http://localhost:3001" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_DOCS_URL=http://localhost:3004" >> apps/app/.env.local | |
echo "NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL=http://localhost:3002" >> apps/app/.env.local | |
- name: Copy .env.local file | |
run: | | |
cp apps/app/.env.local apps/web/.env.local | |
cp apps/app/.env.local apps/api/.env.local | |
- name: Build | |
run: pnpm build |