Skip to content

157 improve env var handling #333

157 improve env var handling

157 improve env var handling #333

Workflow file for this run

# Name of our action
name: Build
# The event that will trigger the action
on:
pull_request:
branches: [main]
env:
# Server
CLERK_SECRET_KEY: "sk_test_JA=="
CLERK_WEBHOOK_SECRET: "whsec_test"
RESEND_AUDIENCE_ID: "test"
RESEND_FROM: "test@test.com"
DATABASE_URL: "postgresql://test:test@localhost:5432/test"
RESEND_TOKEN: "re_test"
STRIPE_SECRET_KEY: "sk_test"
STRIPE_WEBHOOK_SECRET: "whsec_test"
BETTERSTACK_API_KEY: "test"
BETTERSTACK_URL: "https://test.com"
# Client
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: "pk_test_JA=="
NEXT_PUBLIC_CLERK_SIGN_IN_URL: "/sign-in"
NEXT_PUBLIC_CLERK_SIGN_UP_URL: "/sign-up"
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL: "/"
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL: "/"
NEXT_PUBLIC_GA_MEASUREMENT_ID: "G-test"
NEXT_PUBLIC_POSTHOG_KEY: "phc_test"
NEXT_PUBLIC_POSTHOG_HOST: "https://test.com"
NEXT_PUBLIC_APP_URL: "http://localhost:3000"
NEXT_PUBLIC_WEB_URL: "http://localhost:3001"
NEXT_PUBLIC_DOCS_URL: "http://localhost:3004"
NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL: "http://localhost:3002"
# 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: Build
run: pnpm build