update log #19
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: Deploy to Cloudflare Pages | |
on: [push] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
deployments: write | |
name: Deploy to Cloudflare Pages | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 # Use the version of pnpm you need | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' # Use the Node.js version your project requires | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
# The Zod schema in env.mjs expects these environment variables to be set | |
# they don't have to be real values, just pass validation so we can build | |
- name: setup environment variables | |
run: | | |
touch .env | |
echo "DATABASE_URL=libsql://example.turso.io" >> .env | |
echo "TURSO_AUTH_TOKEN=deploy" >> .env | |
echo "STRIPE_SECRET_KEY=deploy" >> .env | |
echo "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=deploy" >> .env | |
echo "STRIPE_WEBHOOK_SECRET=deploy" >> .env | |
echo "RESEND_API_KEY=deploy" >> .env | |
echo "EMAIL_FROM=deploy" >> .env | |
- name: Install Wrangler | |
run: pnpm add -g wrangler | |
- name: Deploy | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_PROJECT_NAME: ${{ vars.CLOUDFLARE_PROJECT_NAME }} | |
run: pnpm run deploy |